Solved

Referencing problem !

Posted on 2006-11-13
5
146 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

734 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