Skip to main content
Participating Frequently
April 21, 2012
Answered

making play button to play different clips

  • April 21, 2012
  • 1 reply
  • 2169 views

how do i make a play button play different movie clips that are placed on to a timeline in actionscript 3?

here is an example of what im doing. so you drag and drop the moive clips on to the timeline, at the bottom which then snaps in to place.

once the timeline has been filed up you press the play button, then it plays all the moive clips in sequence.

This topic has been closed for replies.
Correct answer kglad

what about making a playhead so when it hits the movieclip thats on the timeline it plays the same movieclip in the preview box?


did that last answer resolve your  "making play button to play different clips" issue?

if so, mark that answer as correct and start a new thread for new issues.

1 reply

kglad
Community Expert
Community Expert
April 21, 2012

you assign instance names to each movieclip and button (in the properties panel) and in the actions panel you assign listeners to your buttons that call a listener function that "plays" your movieclip.  for example, if you have a button (btn1) and movieclip (mc1), you could use:

btn1.addEventListener(MouseEvent.CLICK,btn1F);

function btn1F(e:MouseEvent):void{

mc1.play();

}

1richard1Author
Participating Frequently
April 21, 2012

I just done that but it dont work. is there a way for it to play all the movie clips that you have dragged on to the time line.

so for example say i have dragged  Vid2 vid6,vid5, vid10, vid3 and vid11 on to the timeline then press play. playing only them selective movieclips in my preview box?

kglad
Community Expert
Community Expert
April 21, 2012

copy and paste the code you tried.