NetConnection>a_nc =通道
NetStream>a_ns=串流內容
video>a_video
togglePause=內建可重複撥放=resume()+pause()
seek =可停留讀秒
play()


先開新檔案存檔在既存的影音資料夾內

var a_nc:NetConnection = new NetConnection();
a_nc.connect(null)

var a_ns:NetStream = new NetStream(a_nc);
a_ns.client = new Object();

var a_video:Video = new Video();
a_video.attachNetStream(a_ns)
addChild(a_video)

a_video.width = 320
a_video.height = 240
//a_ns.play("train.flv")

var kk:Boolean = false

bpause.addEventListener(MouseEvent.MOUSE_DOWN,dopause)
function dopause (e:MouseEvent):void{
 a_ns.pause()
 }
 
 bplay.addEventListener(MouseEvent.MOUSE_DOWN,doplay)
function doplay (e:MouseEvent):void{
 if(kk == false){
  addChild(a_video)
  a_ns.play("train.flv")
  }else{
     a_ns.resume()
  }
 kk = true 
   }
bstop.addEventListener(MouseEvent.MOUSE_DOWN,dostop)
function dostop(e:MouseEvent):void{
  a_ns.pause()
 removeChild(a_video)
 kk = false
}
bt.addEventListener(MouseEvent.MOUSE_DOWN,dobt)
function dobt(e:MouseEvent):void{
a_ns.togglePause(); 
}

創作者介紹

Genie's Space G妮的小世界

G妮 發表在 痞客邦 PIXNET 留言(0) 人氣()