Question:
Flash action script 3.0 play movie clip button?
2008-10-02 14:16:05 UTC
Hi everyone, thanks in advance for answering my question.

I am trying to make a button that plays a movie clip on Flash CS3 pro. Now i figured out the action script for making a button so that when you click the button, a movie clip sequence plays ( the movie clip is on the main time line instead of a symbol movie clip). However, my question is that if I have multiple movie clip sequences ( either on the time line or as symbol movie clips), and I have different buttons, how can I designate each button to play their respective movie clip sequences? If you could give me the code here, that would be great, if not, please direct me to a website that has the detailed information. Thanks a lot in advance.
Three answers:
2008-10-04 11:55:27 UTC
I'm not sure what you mean by a movie clip on the main time line instead of a symbol movie clip. All movie clips are symbols whether they are placed on the main time line or not.



Anyway, if you want to animate different movie clips after you click each button, you can just place each animation on different frames of the main time line. So you could have an animation run from frame 1 to 10, then on frame 10 open the actions panel and type "stop();" that way the animation stops at frame 10.Then you can have a different animation run from frame 11 to 21 placing "stop();" on frame 21 and so on. So you'd just set up a MouseEvent listener for each button, and then once the button is clicked you'd have it go to and play whatever frame.



button1.addEventListener(MouseEvent. CLICK,

    playAnimation1);



function playAnimation1(event:MouseEvent):void

{

    gotoAndPlay(1);

}



etc...
Brini M
2008-10-02 14:48:43 UTC
i would put the movie clips either on different frames each other or maybe different layers but also down on different frames you can use the same code that you have for each button just designate the frame #
2016-10-19 07:03:54 UTC
i could located the action photograph clips the two on distinctive frames one yet yet another or consistent with hazard distinctive layers yet as properly down on distinctive frames you may desire to apply the comparable code which you have for each button in certainty designate the physique #


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...