Flash Video Streaming Tutorial
Streaming video is ideal for large Internet audiences. When you stream video, the end user is only getting what he needs and not the entire video. This reduces the server's load. Streaming video also helps to protect copyrighted videos, since the end user is not receiving the entire file. You will need a dedicated server such as Adobe's Flash Media Server 2, LightTPD or Primcast.
Instructions
-
-
1
Open Flash and click "File," then "New" and then click "Flash File (ActionScript 3.0)" from the menu.
-
2
Click the pop-down menu on the library panel and then click "New Video," then "OK." Drag the video camera to the stage and give an instance name "myVideo" in the "Property" panel that automatically opens. Change the "W" and "H" to your video size, such as "W" value to "320" and the "H" value to "240."
-
-
3
Create new layers by clicking "Insert Layer" at the bottom of your time line. Name your two layers by double-clicking on the text and typing in a first layer, "Actions," and the second layer, "Labels."
-
4
Right-click on frame "1" in the time line and then click "Action" from the menu. Type in the following code, changing the video name to your video name and location:
var myConnection:NetConnection = new NetConnection();
myConnection.connect(null);
var myStream:NetStream = new NetStream(myConnection);
myVideo.attachNetStream(myStream);
var listener:Object = new Object();
listener.onMetaData = function(md:Object):void{};
myStream.client = listener;
myStream.play("video.flv");
-
1