Same code works in 10.1 and earlier but does not work in 10.2... Is it bug or done intentionally? Is there any way to run VideoEvent in flash player 10.2?
I just discovered this same problem in CS5.5. Could there be something corrupted in the AS properties? Below is the error message I am receiving to the COMPLETE event.
Scene 1, Layer 'Layer 2', Frame 1, Line 8 1119: Access of possibly undefined property COMPLETE through a reference with static type Class.
Here is my code I have used forever...
import flash.events.*;
import fl.video.*;
stop();
theVideo.addEventListener(VideoEvent.COMPLETE, VideoStopped);
function VideoStopped(e:VideoEvent):void{
trace("VIDEO STOPPED");
}//end
There is another thread explaining in more detail. It appears I'm not the only one with this problem.
http://forums.adobe.com/thread/857036
One solution, I can't explain is this. It works but only as a event in the funciton.
import fl.video.VideoEvent;
stop();
theVideo.addEventListener(fl.video.VideoEvent.PLAYING_STATE_ENTERED, VideoReady);
theVideo.addEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped);
theVideo.addEventListener(fl.video.VideoEvent.PLAYHEAD_UPDATE, VideoUpdate);
// These DO NOT WORK
//theVideo.addEventListener(VideoEvent.COMPLETE, VideoStopped);
//theVideo.addEventListener(VideoEvent.PLAYHEAD_UPDATE, VideoStopped);
//theVideo.addEventListener(VideoEvent.READY, VideoStopped);
//theVideo.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, VideoStopped);
function VideoReady(e:Event):void{
trace("READY");
theVideo.removeEventListener(fl.video.VideoEvent.PLAYING_STATE_ENTERE D, VideoReady);
}
function VideoStopped(e:Event):void{
trace("STOPPED");
theVideo.removeEventListener(fl.video.VideoEvent.COMPLETE, VideoStopped);
theVideo.removeEventListener(fl.video.VideoEvent.PLAYHEAD_UPDATE, VideoUpdate);
}
function VideoUpdate(e:Event):void{
trace("UPDATE");
}
North America
Europe, Middle East and Africa
Asia Pacific