| View previous topic :: View next topic |
| Author |
Message |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
Posted: Thu Nov 14, 2002 3:15 pm Post subject: Adding Video Playback in Flash MX |
|
|
If you're interested in learning how to manipulate video in Flash MX; I strongly suggest this book “Flash MX Video” by Kristian Besley, Hoss Gifford, Brian Monnone and Todd Marks. This book has been an inspiration for me and I’ve learned so much about video manipulation and compression for Flash MX. You can check it out here
Download the .fla for this tutorial here: http://www.dc-media.com/video_tutorial/video.fla
Let's get started! When inserting a video file onto it’s own flash movie clip, we can manipulate it’s timeline with a little bit of Action Scripting. We can add a pause, play, fast forward, and fast rewind buttons just like any regular play head.
First import your video file onto a movie clip. This tutorial is not about proper video compressions so I’m not going into details on that. Add another layer and call it actions. Place a stop (); action on the last key frame of the movie clip.
Place an instance of the movie clip you just created on the main stage and give it an instance name of “video”.
Now you must create your play head buttons (pause, play, fast forward and fast rewind) and place them on their own layer on the main stage.
Select the pause button and place this code on it:
| Code: |
on (release) {
_root.video.stop();
}
|
Select the play button and place this code on it:
| Code: |
on (release) {
_root.video.play();
}
|
Now, in order to achieve the fast forward and fast rewind we have to add some Action Script to the actual movie clip. Select the movie clip and add this code to it:
| Code: |
onClipEvent (enterFrame) {
if (_root.ffwd == true) {
frame = this._currentframe +5
this.gotoAndStop (frame);
}
if (_root.frwd == true) {
frame = this._currentframe -5
this.gotoAndStop (frame);
}
} |
Select the fast forward button and add this code to it:
| Code: |
on (press) {
_root.ffwd = true;
}
on (release) {
_root.ffwd = false;
} |
Then, select the fast rewind button and add this code to it:
| Code: |
on (press) {
_root.frwd = true;
}
on (release) {
_root.frwd = false;
} |
Now test your movie and as you can see all the buttons should work just like a regular play head. There, It’s simple and fun to do.
Enjoy!  _________________

Last edited by Mystique on Fri Oct 22, 2004 1:01 pm; edited 1 time in total |
|
| Back to top |
|
 |
blowndeadline
Joined: 13 Apr 2003 Posts: 55
|
Posted: Sun Apr 13, 2003 5:43 pm Post subject: |
|
|
I would like to start out by saying the above thread has helped me out tremendously and I thank you for it!
Now for my question:
How do I add a preloader to this? Soem of the videos I am "streaming" are large, about 2mb. Which for broadband isn't that bad. I would like to implement a simple percentage prelaoder and maybe a simple progress bar. Dosn't have to be fancy, just work with the above example.
Any ideas, tuts or suggestions?
Thanks again for the help you provided indirectly already!
Mike |
|
| Back to top |
|
 |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
|
| Back to top |
|
 |
Peacepole1
Joined: 03 Jun 2003 Posts: 1
|
Posted: Tue Jun 03, 2003 4:33 pm Post subject: video thing |
|
|
just tried it and it was great!
My problem was that when I clicked the rewind button it re-wound and stayed stopped -
I changed the gotoandstop to gotoandplay and now it rewinds then continues playing.
Thanks _________________ on (press) {
_bark.soft = true;
}
on (release) {
_bark.loud = false;
} |
|
| Back to top |
|
 |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
Posted: Wed Jun 04, 2003 7:48 pm Post subject: |
|
|
Excellent... I'm glad you liked it  _________________
 |
|
| Back to top |
|
 |
Leviathan
Joined: 25 Jul 2002 Posts: 178
|
Posted: Thu Jun 05, 2003 4:38 am Post subject: |
|
|
Great tutorial Mystique, even I understand it at the first time.
Very good explained my compliments  |
|
| Back to top |
|
 |
ricalien
Joined: 18 Apr 2004 Posts: 3
|
Posted: Tue May 04, 2004 7:23 pm Post subject: Thank you |
|
|
Thank you for your help
ricalien |
|
| Back to top |
|
 |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
Posted: Tue May 04, 2004 10:49 pm Post subject: Re: Thank you |
|
|
| ricalien wrote: | Thank you for your help
ricalien |
Anytime  _________________
 |
|
| Back to top |
|
 |
pudbat
Joined: 16 Sep 2004 Posts: 1
|
Posted: Thu Sep 16, 2004 1:52 pm Post subject: |
|
|
can you explain to me how to
Place an instance of the movie clip you just created on the main stage and give it an instance name of “video”.
i just started using flash mx and i don't know how to place an instance |
|
| Back to top |
|
 |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
Posted: Mon Sep 20, 2004 9:11 am Post subject: |
|
|
If I'm understanding your question correctly... you simply go to the library menu pallete and drag the video clip onto the stage  _________________
 |
|
| Back to top |
|
 |
ET
Joined: 22 Oct 2004 Posts: 3
|
Posted: Fri Oct 22, 2004 10:41 am Post subject: thanks! |
|
|
THANK YOU SO MUCH! This makes this Friday so much better! I was stressing about this (long story) and then I find this awesome tutorial! Yeay!  |
|
| Back to top |
|
 |
Mystique Moderator

Joined: 23 Jul 2002 Posts: 623 Location: Orlando, FL
|
Posted: Fri Oct 22, 2004 12:59 pm Post subject: |
|
|
You're very welcome  _________________
 |
|
| Back to top |
|
 |
Hila David
Joined: 29 Apr 2005 Posts: 13
|
Posted: Sun May 01, 2005 2:53 pm Post subject: |
|
|
| I agree very very helpful tutorial thanx a lot |
|
| Back to top |
|
 |
|