How to Add Play, Stop, Fast Forward and Rewind buttons to external video
Control how external movies play with stop and play buttons
- Launch Flash Designer and set frame size at 300 x 300 (Frame > Frame Size)
- Change frame to stop (Frame > Frame Delay and check Stop)
- Choose “Insert” > “Flash”
- Type the path to your video file or use the test file “http://www.flashdesignerzone.com/testvideo.swf”
- Choose Item > Placement Properties, change Item Name to “mymovie” and check ActionScript Target, click OK
- Choose Insert > Navigation and choose Play, repeat the same and insert Stop button.
- Select Play button and choose Action > OnClick
- Check ActionScript and type the code:mymovie.play();
- Select Stop button and choose Action > OnClick
- Check ActionScript and type the code:mymovie.stop();
- Hit F9 for preview
Download surce code here
Adding Fast Forward and Rewind buttons
- Choose Insert > Navigation and choose Fast Forward, repeat the same and insert Rewind button.
- Select Forward button and choose Action > OnClick
- Check ActionScript and type the code:movieforward=1;
- Select the Forward button and choose Action > OnUp
- Check ActionScript and type the code:movieforward=0;
- Select the Rewind button and choose Action > OnClick
- Check ActionScript and type the code:movieforward=-1;
- Select the Forward button and choose Action > OnUp
- Check ActionScript and type the code:movieforward=0;
- 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); - Hit F9 for preview
Download surce code here