Solved

Referencing problem !

Posted on 2006-11-13
5
142 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
ID: 17932018
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
ID: 17936832
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
ID: 17936892
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
ID: 19468884
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

920 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

16 Experts available now in Live!

Get 1:1 Help Now