-
Senior Member
Enable button in different .swf
I have a button inside a movie clip and it needs to enable a button on a .swf file that is loaded. How do I properly target it? Thank you.
-
Total Universe Mod
A fully quailfied reference for a loaded movie always includes the name of the instance you loaded it into.
So if you had a target called mySwfHolder and you wanted to load a movie called loadedSwf.swf and inside loadedSwf.swf was a button with the instance name myButton:
//to load the movie
mySwfHolder.loadMovie('loadedSwf.swf');
//to talk to the button
mySwfHolder.myButton.onRelease = function(){
...
}
-
Senior Member
Originally Posted by jAQUAN
A fully quailfied reference for a loaded movie always includes the name of the instance you loaded it into.
So if you had a target called mySwfHolder and you wanted to load a movie called loadedSwf.swf and inside loadedSwf.swf was a button with the instance name myButton:
//to load the movie
mySwfHolder.loadMovie('loadedSwf.swf');
//to talk to the button
mySwfHolder.myButton.onRelease = function(){
...
}
This is what I have...and it doesn't seem to work:
_parent.mc_container.video.enabled = true;
-
Total Universe Mod
Just before that line of code, add this line:
trace(_parent);
That way you can test to see if _parent is actually referring to what you want. If it isnt you may need to say this._parent or even _parent._parent
What are you trying to acheive by toggling enabled?
-
Senior Member
How do you output the trace to find out the value? In my output window it says level0, does this have anything to do with that? I tried both this._parent and _parent._parent and neither worked.
I have a movie clip that appears over a menu, this movie clip contains new buttons. I have to disable the menu buttons so that there not accidentally clicked.
-
Total Universe Mod
level0 is the same as _root.
If mc_container is on the main timeline, it should work. All mc's are enabled by default so unless you are changing enabled to false somewhere else there's no need.
-
Senior Member
I tried using _root. and that didn't work either. I remember being told on this forum to refrain from using _root, and to only use _parent and this.
mc_container is on the main timeline. I'm attempting to control the button (enabled) in another movie clip that is on the main timeline.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|