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
Solved

Referencing problem !

Posted on 2006-11-13
5
144 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flash doesn't load in Iphone and Ipad 22 492
High definition conversion videos in YouTube 12 289
bandwidth 5 74
Converting CFGRID from Flash to HTML in Coldfusion 1 101
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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.
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.

792 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