Sunday, January 3, 2010

Quick and Dirty FLV


  1. Goto the Library panel and click on the little button on the top right corner of the title bar.
  2. Choose “New Video” from the menu. This creates an embedded video object in your library.
  3. Drag this video object onto the stage and resize to the dimensions of your FLV.
  4. Give the video object an instance name. We’ll use “theVideo” for example.
  5. Create a blank layer named “Actions” and lock it.
  6. Highlight the first keyframe and open the actions panel.
  7. Paste in the following code:
[as]var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play(“URL_OF_YOUR_FLV”);[/as]
  1. Test the movie and you should see the video playing.
  2. Smile :-)