dvine
05-17-2010, 02:09 AM
Guys,
I have seriously tried my best (I believe) at getting this to work. Simple for most I suspect. But I just cannot get it to work the way it needs to work.
It is a simple play button on frame 1. Once the button is pressed the video plays. I need it to return to frame 1 on flv playback completion.
The best result I have gotten thus far is playback of the FLV with it not returning to frame 1.
Please shed some light, I am stressing and pulling my hair out not knowing what is wrong.
I don’t know if the VideoEvent function is working or not. When I do the declare the video_mc outside of a function the video plays in the background (you can only hear the audio). This is the reason I initially declared the video_mc variable inside of the MouseEvent function as this works fine. I am not sure if this is the correct way of doing it, but it works in my instance.
stop();
import fl.video.VideoEvent;
playBtn.addEventListener(MouseEvent.CLICK, startVideo);
video_mc.addEventListener(VideoEvent.COMPLETE, onVideoComplete);
function startVideo(event:MouseEvent):void
{
var video_mc:video = new video();
addChild(video_mc);
trace("video_mc working");
}
function onVideoComplete(event:VideoEvent)
{
gotoAndStop(1);
trace("restart function working");
}
Thank for any assistance in advance.
Cheers...
I have seriously tried my best (I believe) at getting this to work. Simple for most I suspect. But I just cannot get it to work the way it needs to work.
It is a simple play button on frame 1. Once the button is pressed the video plays. I need it to return to frame 1 on flv playback completion.
The best result I have gotten thus far is playback of the FLV with it not returning to frame 1.
Please shed some light, I am stressing and pulling my hair out not knowing what is wrong.
I don’t know if the VideoEvent function is working or not. When I do the declare the video_mc outside of a function the video plays in the background (you can only hear the audio). This is the reason I initially declared the video_mc variable inside of the MouseEvent function as this works fine. I am not sure if this is the correct way of doing it, but it works in my instance.
stop();
import fl.video.VideoEvent;
playBtn.addEventListener(MouseEvent.CLICK, startVideo);
video_mc.addEventListener(VideoEvent.COMPLETE, onVideoComplete);
function startVideo(event:MouseEvent):void
{
var video_mc:video = new video();
addChild(video_mc);
trace("video_mc working");
}
function onVideoComplete(event:VideoEvent)
{
gotoAndStop(1);
trace("restart function working");
}
Thank for any assistance in advance.
Cheers...