It might seem a little complicated but its really not that bad. We'll start with just playing a video back without the playback component..
Try this,
go to your library: hit the little 'bulleted list' icon in the top right corner and choose 'new video'
a video symbol will appear in your library, drag this to your main stage and give it an instance name of 'video' (properties panel)
now create a new layer called 'actions', hit the first frame and fire up the actions panel:
Copy the following into the actions panel:
Code:
nc = new NetConnection(); //create new net connection
nc.connect(null);
ns = new NetStream(my_nc); //creates new netstream
ns.setBufferTime(6); // sets the download buffer
video.attachVideo(ns); // attaches netstream to video object
ns.play(thefile);// attaches the flv to the netstream
Now we'll go through each line:
line 1: creates a netconnection object which, when used in conjunction with the netstream, enables us to stream an FLV over HTTP protocol
line 2: ignore for now (not relevant for what we're doing at this stage)
line 3: creates the netstream to stream the FLV over HTTP
line 4: sets the playback buffer to '6' seconds so that the FLV won't intiate playback until 6 seconds of video have already been downloaded (this helps prevent the video playback exceeding the amount already downloaded)
line 7: attaches the netstream (carrying the FLV) to the video object on the stage that we created earlier
line 8: points the netstream to the location of the FLV, '(thefile)' should be replaced with the url to your FLV i.e. '
Cool.. that's it, try testing the movie. After a short period while the video buffers, you should see it pop up on the stage.
I'll leave it there for now so if you want further advice on how to take this further, let me know