Movie Play Forward or
Backward-Simulate Video Player
Want to make a video player with buttons process
control block totally by yourself? Want
to add a favorite Flash to your video player? SWF Quicker can do share all these
experience with you. Welcome to our tutorial house!
Series: SWF Quicker 2.0
Can you imagine how to make it?
1 Launch SWF Quicker and Look at
the Properties panel. Set movie's width as 500, height as
470.
Create a new movie clip and import a SWF file as our video to this movie clip.
In this example, we choose a commonweal AD as the imported SWF.
It is better to notice that Actionscript can not control the sub-movie clip,
which continues to play when you press button to stop the main movie clip. So
you should break apart the sub-movie clip first.
Drag the movie clip to the stage from library and enter "video" as
its instance name.
2 Create buttons such as stop,
back, pause, play, etc. Details are not shown here.
[endif]
3 Create another movie clip to
show play state. I show you timeline as following. Position a blank dynamic
text block, set the properties as Font: Arial; Font size: 16; Font color: red; Var: info. The information shown in the text block lasts
for 24 frames while you press one of the buttons. The actionscript of frame [endif]
Drag the movie clip, which is to show play
state to stage and enter "infoMC" as its
instance name.
4 Add
actionscript to frame 1 to initialize process. In addition, set the
corresponding function for later use.
Code: |
//use displayed information by this function. |
5 Add
actionscript to each button. Stop, Pause, Play three buttons are simpler
comparing to others. Please notice you should set the value of _root.playing for video play state.
The codes of Stop button are as follows:
Code: |
on (release) |
The codes of Pause button are as follows:
Code: |
on (release) |
The codes of Play button are as follows:
Code: |
on (release) |
6 The value of Play Forward
button and Play Backward button is TRUE when it is pressed to set _root.forward or _root.back. The
event onEnterFrame executes the corresponding program
to video when it checks out the value changes. The video backs to the original
play state when mouse is released according to _root.playing.
The codes of Play Forward button are as follows:
Code: |
on (press) |
The codes of Play Backward button are as follows:
Code: |
on (press) |
7 Buttons "Skip a
Frame" and "Back a Frame" are easier comparing with the above
two. You can make them by prevFrame() and nextFrame() of movie clip.
Please remember to set the value of _root.playing
because the video is still pause after you use the two functions.
The codes for Skip a Frame button are as follows:
Code: |
on (release) |
The codes for Back a Frame button are as follows:
Code: |
on (release) |
9 Ok, work is almost done. The
rest is depending on your beautification. For that the video may display
expending the limited area, you need to add a mask area. It is better if a
background is added to furnish the group of buttons.
The process control block, which is designed to simulate the play process, is
easier comparatively. The rule is to specify the process position by the
properties of _currentframe and _totalframes
in video.
» Level Intermediate |
Added: 2005-12-28 Rating: 7 Votes: 9 |
» Author |
Want to get a new level of expressiveness and efficiency to create presentations, interactive experiences and websites? Want to engage, enlighten and empower yourself so that you can get more out of now? SWF Quicker is the right kit to get them all. Creative you can definitely design professional Flash movies rich with all things you need. So, no more guessing! Try Versatile Flash Maker now! |
» Download |
Download the files used in this tutorial. |
Download (0 kb) |
» Forums |
More help? Search our boards for quick answers! |