video.Maru
by polyGeek polyGeek logo



 

playback controls

June 24th, 2007 . by polyGeek
polyGeek TV Watch video tutorial on creating playback controls

The main video controls consist of the play/pause toggle button and the stop button.

Create a play/pause toggle by creating a MovieClip and giving it an instance name of play_btn or pause_btn. The difference between the two choices is that play_btn will cause the video to play automatically while using the instance name pause_btn will cause the video to start paused and wait for the user to click the button.

The button toggle supports two states that you can create by going into the MovieClip and creating two keyframes with Framelabels of playing and paused. The video.maru code will automatically gotoAndStop() on the Framelabel that corresponds to the state of the video. So an instance name of play_btn will cause the MovieClip to display the state on the Framelabel paused, and visa-versa.

Of course each Framelabel could have an animated MovieClip that animates if you wish. For those animations you will have to add your own stop() commands.

The stop button is simple enough. Create a MovieClip with an instance name of stop_btn and when the user clicks on it the video will stop and return to the beginning.