flash animation video tutorials

 

 

 

 

 

START LEARNING
FLASH NOW

Get instant access to over
45 minutes of FREE Flash tutorials on video
 and our newsletter.

Name:
E-Mail:

.

.

.

 
Web video-animation.com

.

.

flash tutorials flash tutorials flash tutorials flash tutorials

Flash 8 flv video player

This tutorial will go through the steps needed to create a simple flash8 video player for player .flv videos. This Flash 8 tutorial was taken off the brilliant work done by Lee Brimelow at GotoandLearn.com Who has done a lot of great work using NetConnection and NetStream Objects to create the code to play videos. The NetConnection and NetStream objects are Actionscript code that is used in Flash Media Server 2.
So first up you will need to convert the video to .flv format. You may have an .avi or a quicktime(.mov) file. I have used the Riva FLV Encoder 2.0 to convert my .avi files to .flv.
I had set the encoder to a resolution of 320x240 and a framerate of 15fps. Put the .flv file in the same folder as the flash file that you are going to create. I named the flv file tkd01.flv.

Flash Tutorials in Video Format - Watch them now at LearnFlash.com  

Create a new flash file.
Change the layer name to actions and lock it.
Create a new layer, name it video and select the first frame.
Open the library (F11) and click on the triangle at the top right of the Library window.
Select New Video. Give it a name.
Drag the video object to the stage, on the video layer, frame 1.
Set the size of the video that you want. W = 320, H = 240
Give the video object an instance name - myVideo.

Now you need to put in the code to play the external video.
Put this code into frame 1, actions layer.


stop();
// create a netConnection object
	var nc:NetConnection = new NetConnection();
// connect to null
	nc.connect(null);
// create netStream object
// and pass the netConnect to it
	var ns:NetStream = new NetStream(nc);
// attach the netStream object to the embedded video object
	myVideo.attachVideo(ns);
// netSTream object plays the video
	ns.play("tkd01.flv");

Now create a new layer and call it buttons or such and make two buttons for rewind and play.
Call them rewind_btn and play_btn.
Now add this code to allow us to rewind and play and pause the video.

// code for control buttons
// rewind button takes the play head to beginning
rewind_btn.onRelease = function(){
	// send the playhead to 0 seconds
	ns.seek(0);
}
// play button
play_btn.onRelease = function(){
	// toggle between pause and play
	ns.pause();
}

Flash 8 Resources

XML Playlist for flv videos - go on to the next part of this Flash 8 tutorial which creates an xml playlist for the flv video player.

.

flash 8