A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Play/pause button

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    11

    Play/pause button

    Hi,
    Does anyone know how to create a play/pause button to control my movie animation?

  2. #2
    |-'|-'|
    Join Date
    Jan 2006
    Posts
    273
    is your movie all in one movieclip or on stage? if yes, then it's very simple. Make a new layer spanning the whole length, make a button. then try this code on the very first frame of the movieclip.
    Code:
    play();
    var playing:Boolean = true;
    play_btn.onRelease = function(){
         if(playing){stop();playing=false;}
         else{play();playing=true;}
    };
    unless if someone can come up with more efficient code.

  3. #3
    Junior Member
    Join Date
    Apr 2009
    Posts
    11
    thats brilliantly simple and efficient, thankyou. I tried another method from an online tutorial yesterday and it was too complex for a simple operation.

  4. #4
    Junior Member
    Join Date
    Aug 2015
    Posts
    1
    Your code saved me!!! We should be so lucky to have people willing to share.

    Thank you!

    Junior

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center