Solved

Referencing problem !

Posted on 2006-11-13
5
141 Views
Last Modified: 2010-04-03
Hello.

On my clip (which is called objHover) I have the following code:

onClipEvent(data)
{
      strName = Name;
}

onClipEvent(load)
{
      loadVariables ("testinfo.html", this);
}


And this works fine. The field called strName gets populated.
But when I try and move it into my main action layer, it stops working. Here is my code:

objHover.onData = function () {
      strName = Name;
}

objHover.onLoad = function () {
      loadVariables("testinfo.html", objHover);
}

Could someone please tell me what is wrong there? Any help would be greatly appreciated. Thanks.
0
Comment
Question by:bLUE
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
Comment Utility
onClipEvent(data) and onClipEvent(load) can't be written as you are trying here...

only "MovieClip.onEnterFrame" is supported outside MovieClip...

alternative to ur code, you can simply assign variables as following:
----------
objHover.strName = Name;
objHover.loadVariables("testinfo.html", objHover);
---------

-Aneesh
0
 
LVL 1

Author Comment

by:bLUE
Comment Utility
Hey Aneesh.

Thanks for your response. I tried that but it didnt work? Any ideas? I put the code into my main action layer.
0
 
LVL 1

Author Comment

by:bLUE
Comment Utility
I think this works:

myVars = new LoadVars();
myVars.load("testinfo.html");


myVars.onLoad = function (success) {
     if (success) {
        trace (" variables loaded ");
        trace(myVars.Name);
    } else {
        trace (" Error loading variables ");
    }
}
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now