Simple question I'm sure

Got a simple question for the rest of you actionscript jockeys.

Lets say I dropped a move clip onto the stage, and the movie clip contains
buttons. these buttons were created within the movie clip, but when the user clicks on them i would like them to play instances that exist in the main stage.

how would i script the release action then? obviously the usual on (release) instancename.play(); would not work, so i’m wondering if any one could help me out a bit.

please let me know

Thanks

  • yukon-admin

You can reference these instances with ‘_root.instancename.play()’. Or you can adress them with _parent from within the current movieclip.

Hope this helps

thanks for the help sintax :slight_smile:

if the user first clicks the button (which launches a clip) then afterwords clicks any other buttons, in the _parent or otherwise; how would i get that ‘click’ to play another movie action?

on another note. right now i am at the office working on some of my own personal stuff. at home i have all kinds of reference materials, and useful handbooks that would prevent me from bugging you people for more code questions. just right now you are the only ones i can turn too with a direct question. i appreciate any help you can give.

you can adress all movieclips absolutely from the _root, using the ‘_root.instancename’ syntax.

so if you have a button or a movieclip, that needs to activate a movieclip situated somewhere else, just use the correct path to adress it, be it absolute (with _root) or relative (using _parent).

for example: ‘_root.movieclip1.submovieclip’ can activate another movieclip that located on ‘_root.movieclip3’ by adding ‘.play()’

So, am I making sense here?
If i’m not quite clear, just lemme know

maybe i should ask the question in a different way.

suppose you click on a button which launches an action (plays a movieclip).

now when the user clicks on any other button; your movieclip
is still sitting there. what you want is that movie clip to fade out or some thing
so that the navigation appears more smooth. this way there won’t be any more clips running while the user goes from one button to the other.

that is what i’m trying to achieve here. so when the user clicks on a different button. the previous movieclip dissappears or what ever so that the next buttons content appears by itself, and not with the other content still on the screen. know what i mean?

depends on how the movieclips are displayed… if you load them in from external swfs into a content movieclip for example, then you can unload that movie, or replace the content with the new content.

if the movieclips are just in your library, then you can toggle the visibility.

[AS]
on(release) {
_root.instancename._visible = false; //the movieclip becomes invisible
_root.instancename._visible = true; // this one becomes visible
}
[/AS]

you can also let the movieclips fade out using _alpha and for example an interval or an on(enterframe) event.

oh man… thanks sintax!

would you believe i’ve done that in the past about a dozen times.
man… i’m stupified that i didn’t remember it.

guess i should go through some of my old sites some times. might be a good reminder of some of the things i’ve done.

thanks man. sorry to have bothered you about it.

no problem dude, we’re here to help eachother :wink: