flash on 2011-10-3

by poepoemix
♥0 | Line 32 | Modified 2011-10-03 13:51:05 | MIT License
play

ActionScript3 source code

/**
 * Copyright poepoemix ( http://wonderfl.net/user/poepoemix )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/86og
 */

package {
    import flash.events.Event;
    import flash.net.FileFilter;
    import flash.media.Video;
    import flash.net.FileReference;
    import flash.net.NetStream;
    import flash.net.NetConnection;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        private var nc:NetConnection;
        private var ns:NetStream;
        private var file:FileReference;
        public function FlashTest() {
            nc = new NetConnection();
            nc.connect(null);
            ns = new NetStream(nc);
            var video:Video = new Video;
            video.attachNetStream(ns);
            addChild(video);
            file = new FileReference();
            file.addEventListener(Event.SELECT, onSelectFile);
            file.addEventListener(Event.COMPLETE, onLoadFile);
            var fileFilter:FileFilter = new FileFilter("*.flv", "*.flv");
            file.browse([fileFilter]);
        }
        public function onSelectFile(event:Event):void {
            file.load();
        }
        public function onLoadFile(event:Event):void {
//s            ns.play(null);
//s            ns.append
        }


    }
}