Placering af stop action i actionsscript 3?
Har lavet følgende video udfra en tutorial:var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.play("TestNyFilm.flv");
function onMetaData(info:Object):void{
trace("You have recieved your metadata");
}
var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid.x = 0;
vid.y = 0;
vid.width = 250;
vid.height = 170;
pauseBtn.addEventListener(MouseEvent.CLICK, pauseHandler);
playBtn.addEventListener(MouseEvent.CLICK, playHandler);
stopBtn.addEventListener(MouseEvent.CLICK, stopHandler);
function pauseHandler(e:MouseEvent):void
{
ns.pause();
}
function playHandler(e:MouseEvent):void
{
ns.resume();
}
function stopHandler(e:MouseEvent):void
{
// Pause the stream and move the playhead back to
// the beginning of the stream.
ns.pause();
ns.seek(0);
}
Hvordan får jeg videoen til at være stoppet når man kommer ind på siden, den skal være på...?
Nu starter den automatisk..
Har prøvet at sætte stop(); ind men den starter uanset hva?