views:

729

answers:

1

Hey,

I am very new to Flash and Actionscript. I am trying to simply play an FLV file. I have the following:

import flash.MovieClip;
import flash.Video;
import flash.NetConnection;
import flash.NetStream;


class Program {
private var container_mc : MovieClip;
private var video_mc : Video;


public function new() {


   var mc : flash.MovieClip = flash.Lib.current;

          container_mc =  flash.Lib._root.attachMovie("VideoContainer", "container_mc", 0);

          container_mc.attachMovie("VideoClip", "video_mc", 1);

    var my_nc:NetConnection = new NetConnection();

    my_nc.connect(null);

 trace(my_nc.isConnected);

    var my_ns:NetStream = new NetStream(my_nc);

 //my_ns.setBufferTime(1);



    container_mc.video_mc.attachVideo(my_ns);

    my_ns.play("default.flv"); 

 trace("Done"); 
}
 public static function main()
 {
     new Program();
 }
}

I get the "Done" trace message back but no video playback. I simple have a black box in the browser window. Can someone help me out? Thanks a ton!

-Nick

+1  A: 

You should double check to make sure you have two movieclips in the library that have the linkage IDs that you're trying to attach.

You'll need both:

VideoContainer
VideoClip
Alex Jillard