_sheep_
06-29-2005, 06:22 PM
Hi...i was just wondering I have a button which also is like a movie clip thingy and I want the movie clip to only play when it is clicked.....so when it is clicked it plays the link is loaded and the movie stops then i want it to stay like that until another button is clicked....any idea how to do this ? please repy its for a schools website!!
Hi -
If you're wanting to have an animation play when the user presses a button, it's hard to get very far by placing a clip in the button's Over state - since when it's not Over, it's over...
Try making the button play a movie clip that's on stage but invisible, [somewhere before you need it add the action to your main timeline: myClip_mc._visible=false;] and if you want that clip to play indefinitely,
don't put a stop(); action on it's timeline.
So, to get it playing and to be seen, place the button and movie clip on stage & given instance names [like myButton_btn and myClip_mc], then add to fr. #1 in mn. t-line:
myButton_btn.onPress=function(){
myClip_mc._visible = true;
}
If you decide that it's irritating, and want to stop that clip, re-arrange it's timeline so that after your animation you have a blank keyframe that's labeled "_end" with a stop(); action on it. In the frame *prior* to _end, put:
gotoAndPlay(1);
That way, it'll continue to loop/play until you create an event to stop it like:
myButton2_btn.onPress=function(){
myClip_mc.gotoAndPlay("_end");
myClip_mc._visible=false;
}
Hope it helps to get you started,
El
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.