dimanche 20 novembre 2016

How to play mp4 or any format videos form a folder in Actionscript 3 in flash CS6

I have also tried this code

package { import flash.display.Sprite; import flash.net.NetConnection; import flash.net.NetStream; import flash.text.TextField; import flash.media.Video;

       public class Exploit extends Sprite
       {

          public function Exploit()
          {
             greeting = new TextField();
             super();
             greeting.text = "Loading...";
             greeting.x = 100;
             greeting.y = 100;
             addChild(greeting);
             MyVideo = new Video();
             addChild(MyVideo);
             MyvideoNC = new NetConnection();
             MyvideoNC.connect(null);
             MyvideoNS = new NetStream(MyNC);
             MyvideoVideo.attachNetStream(MyNS);
             MyvideoNS.play("videos/song.mp4");
          }

          public var MyvideoNC:NetConnection;

          public var MyvideoNS:NetStream;

          private var greeting:TextField;

          public var MyvideoVideo:Video;
       }
    }

Aucun commentaire:

Enregistrer un commentaire