On my website, I have buttons that animate with a movie clip on the over and down states. I am having trouble targeting and stopping the movie clip from playing on an onRelease event. By continuing the animation, the nested movie clip slows down the .swf file that loads on the right side of the page. Any help on this matter would be greatly appreciated. Thank you.
how are you trying to stop the movie now?
normally, you would take it to and end frame
(assuming you have named frames)… _root.button.mc.gotoandstop(“stop”);
There is no predetermined time to stop the clip, only when the user releases the mouse button. The clip continues to the end if someone clicks on the button right away, I want it to stop in it’s tracks on the button release. I’ve tried targeting and addressing the clip every way possible (this., _root., even the deprecated tellTarget) and then using a stop(); command, but nothing seems to work. Is there a special way to address a movie clip that resides inside a button’s timeline? Thank you again.
You are not really stopping it in its tracks. You are simply sending it somewhere else and telling it to stop there.
For instance, I would create a keyframe somewhere PAST the end of your button animation. At the end of your button animation, you should have a stop(); Right after it, you have a keyframe of the button (whatever state you want). That is the frame you want to call onRelease.
Did you try it that way?
Yes, I did try that but the movie clip continues without interuption. I have a feeling it may be a couple of different things I need to check into 1) The proper way to target the movie clip in the button. (The clip instance is called “enlightentext”, the button is “enlighten”, which resides on the main timeline.
2) Since the clip is on the buttons over state, it may be trying to stop, but begins playing again instantaneously because the mouse remains over the button after release. Thanks agian for you quick responses.
quick and very rough example.
This example is definitely what I require. Although, I am going to have to do some reworking of my movie and take the movie clips out of button timelines.
If this is unneccessary, let me know, otherwise thank you for your help.
Erik
Hmm… I really never do that anymore. As a matter of fact, I never use buttons anymore either, since movie clips do just about everything a button does.
Oh… you’re very welcome.