benhg
12-29-2007, 09:00 AM
hello,
i am trying to have a flv loop continuously, but i cant figure it out. Here is my code:
var videoConnection:NetConnection = new NetConnection();
var videoStream:NetStream;
var md_obj:Object = new Object();
var bgVideo:Video = new Video();
videoConnection.connect(null);
videoStream = new NetStream(videoConnection);
bgVideo.attachNetStream(videoStream);
md_obj.onMetaData = metaData;
videoStream.client = md_obj;
videoStream.play("flv/sp_backgroundVideo01.flv");
bgVideo_mc.addChild(bgVideo);
Now i have tried adding this code:
videoStream.addEventListener(VideoEvent.COMPLETE, loopVideo);
function loopVideo(event:VideoEvent):void {
videoStream.play();
}
but i keep getting this error:
1046: Type was not found or was not a compile-time constant: VideoEvent.
i have also tried adding both of these lines at the start:
import fl.video.*;
import fl.video.VideoEvent;
can anyone help me?
Thanks
i am trying to have a flv loop continuously, but i cant figure it out. Here is my code:
var videoConnection:NetConnection = new NetConnection();
var videoStream:NetStream;
var md_obj:Object = new Object();
var bgVideo:Video = new Video();
videoConnection.connect(null);
videoStream = new NetStream(videoConnection);
bgVideo.attachNetStream(videoStream);
md_obj.onMetaData = metaData;
videoStream.client = md_obj;
videoStream.play("flv/sp_backgroundVideo01.flv");
bgVideo_mc.addChild(bgVideo);
Now i have tried adding this code:
videoStream.addEventListener(VideoEvent.COMPLETE, loopVideo);
function loopVideo(event:VideoEvent):void {
videoStream.play();
}
but i keep getting this error:
1046: Type was not found or was not a compile-time constant: VideoEvent.
i have also tried adding both of these lines at the start:
import fl.video.*;
import fl.video.VideoEvent;
can anyone help me?
Thanks