Flash Goddess Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Adding Video Playback in Flash MX

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Flash Goddess Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Thu Nov 14, 2002 3:15 pm    Post subject: Adding Video Playback in Flash MX Reply with quote

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! Very Happy
_________________


Last edited by Mystique on Fri Oct 22, 2004 1:01 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
blowndeadline



Joined: 13 Apr 2003
Posts: 55

PostPosted: Sun Apr 13, 2003 5:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Sun Apr 13, 2003 8:22 pm    Post subject: Reply with quote

Flashkit is loaded with preloader tutorials I suggest you start there Wink

http://www.flashkit.com/tutorials/Actionscripting/Basic/Percenta-Chris_Be-870/index.php

Hope this helps any.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Peacepole1



Joined: 03 Jun 2003
Posts: 1

PostPosted: Tue Jun 03, 2003 4:33 pm    Post subject: video thing Reply with quote

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
View user's profile Send private message Visit poster's website
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Wed Jun 04, 2003 7:48 pm    Post subject: Reply with quote

Excellent... I'm glad you liked it Very Happy
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Leviathan



Joined: 25 Jul 2002
Posts: 178

PostPosted: Thu Jun 05, 2003 4:38 am    Post subject: Reply with quote

Great tutorial Mystique, even I understand it at the first time.
Very good explained my compliments Very Happy
Back to top
View user's profile Send private message
ricalien



Joined: 18 Apr 2004
Posts: 3

PostPosted: Tue May 04, 2004 7:23 pm    Post subject: Thank you Reply with quote

Thank you for your help

ricalien
Back to top
View user's profile Send private message
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Tue May 04, 2004 10:49 pm    Post subject: Re: Thank you Reply with quote

ricalien wrote:
Thank you for your help

ricalien


Anytime Smile Smile Smile
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
pudbat



Joined: 16 Sep 2004
Posts: 1

PostPosted: Thu Sep 16, 2004 1:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Mon Sep 20, 2004 9:11 am    Post subject: Reply with quote

If I'm understanding your question correctly... you simply go to the library menu pallete and drag the video clip onto the stage Wink
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ET



Joined: 22 Oct 2004
Posts: 3

PostPosted: Fri Oct 22, 2004 10:41 am    Post subject: thanks! Reply with quote

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! Very Happy
Back to top
View user's profile Send private message
Mystique
Moderator


Joined: 23 Jul 2002
Posts: 623
Location: Orlando, FL

PostPosted: Fri Oct 22, 2004 12:59 pm    Post subject: Reply with quote

You're very welcome Very Happy
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Hila David



Joined: 29 Apr 2005
Posts: 13

PostPosted: Sun May 01, 2005 2:53 pm    Post subject: Reply with quote

I agree very very helpful tutorial thanx a lot
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Flash Goddess Forum Index -> Tutorials All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Google
 




Powered by phpBB © 2001, 2005 phpBB Group