2 Replies Latest reply on Jan 23, 2007 1:21 AM by JaxonRice

    flex flv player using AS 3.0

    JaxonRice
      Hi

      I am starting to learn the Flex IDE and was hoping someone could point me in the right direction.

      The following AS3.0 script plays a flv when using Flash 9.0 public Alpha. How would I make that same code work in Flex?

      var nc:NetConnection = new NetConnection();

      nc.connect(null);

      var ns:NetStream = new NetStream(nc);
      var vid:Video = new Video(320, 240);
      this.addChild(vid);
      vid.attachNetStream(ns);
      ns.play("test.flv");
      ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
      function netstat(stats:NetStatusEvent)
      {
      trace(stats.info.code);
      }
      var netClient:Object = new Object();
      netClient.onMetaData = function(meta:Object)
      {
      trace(meta.duration);
      };

      ns.client = netClient;

      Thanks in advance