bLUE
asked on
Referencing problem !
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.ht ml", objHover);
}
Could someone please tell me what is wrong there? Any help would be greatly appreciated. Thanks.
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.ht
}
Could someone please tell me what is wrong there? Any help would be greatly appreciated. Thanks.
ASKER
Hey Aneesh.
Thanks for your response. I tried that but it didnt work? Any ideas? I put the code into my main action layer.
Thanks for your response. I tried that but it didnt work? Any ideas? I put the code into my main action layer.
ASKER
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 ");
}
}
myVars = new LoadVars();
myVars.load("testinfo.html
myVars.onLoad = function (success) {
if (success) {
trace (" variables loaded ");
trace(myVars.Name);
} else {
trace (" Error loading variables ");
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
only "MovieClip.onEnterFrame" is supported outside MovieClip...
alternative to ur code, you can simply assign variables as following:
----------
objHover.strName = Name;
objHover.loadVariables("te
---------
-Aneesh