Selteco.com > FlashDesignerZONE.com > Tutorials > T1065

Stop and Play buttons for external movies.

Control how external movies play with stop and play buttons

Download source project t1065.zip (2 kb)

  1. Launch Flash Designer and set frame size at 300 x 300 (Frame > Frame Size)
  2. Change frame to stop (Frame > Frame Delay and check Stop)
  3. Choose "Insert" > "Flash"
  4. Type the path to your video file or use the test file "http://www.flashdesignerzone.com/testvideo.swf"
  5. Choose Item > Placement Properties, change Item Name to "mymovie" and check ActionScript Target, click OK
  6. Choose Insert > Navigation and choose Play, repeat the same and insert Stop button.
  7. Select Play button and choose Action > OnClick
  8. Check ActionScript and type the code:

    mymovie.play();

  9. Select Stop button and choose Action > OnClick
  10. Check ActionScript and type the code:

    mymovie.stop();

  11. Hit F9 for preview

Adding Fast Forward and Rewind buttons

Download source project t1065a.zip (2 kb)

  1. Choose Insert > Navigation and choose Fast Forward, repeat the same and insert Rewind button.
  2. Select Forward button and choose Action > OnClick
  3. Check ActionScript and type the code:

    movieforward=1;

  4. Select the Forward button and choose Action > OnUp
  5. Check ActionScript and type the code:

    movieforward=0;

  6. Select the Rewind button and choose Action > OnClick
  7. Check ActionScript and type the code:

    movieforward=-1;

  8. Select the Forward button and choose Action > OnUp
  9. Check ActionScript and type the code:

    movieforward=0;

  10. Choose Frame > ActionScript and type the code to handle rewind or fast forward flags:

    function moviecontrol() {
    if(movieforward==-1) mymovie.gotoAndPlay(mymovie._currentframe-5);
    if(movieforward==1) mymovie.gotoAndPlay(mymovie._currentframe+5);
    }
    
    movieforward=0;
    setInterval(moviecontrol,10);
    
  11. Hit F9 for preview

Products | Purchase | Downloads | Support | Flash Tutorials | Contact
Copyright © 1999-2017 Selteco Software, Inc. www.selteco.com, ph: +1 810 377 5778