Question

I have an FLVPlayback component, instance named flvPlayer. The code below is in frame 1 of intro scene, which works perfectly fine in Flash CS5 but not in CS6! Obviously I want the video player to jump to the next scene when the video reaches the end.

import fl.video.*;

flvPlayer.source = "videos/1.flv";

flvPlayer.addEventListener(VideoEvent.COMPLETE, completeHandler);

function completeHandler(event:VideoEvent):void
{
    MovieClip(this.root).gotoAndPlay(1, "mainScene");
}

in CS6, it gives me this compile error:

enter image description here

Was it helpful?

Solution

It is probably, not the problem of CS5 or CS6, but the target runtime version of flash.

VideoEvent.COMPLETE is defined in flash 10.1 & below.

Try using Event.COMPLETE instead of VideoEvent.COMPLETE (From this discussion)

OTHER TIPS

I suspect a weird namespace issue with the latest CS6/Flash stuff. Try replacing all VideoEvent references with its full namespace fl.video.VideoEvent:

import fl.video.*;

flvPlayer.source = "videos/1.flv";

flvPlayer.addEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);

function completeHandler(evt:fl.video.VideoEvent):void
{
    MovieClip(this.root).gotoAndPlay(1, "mainScene");
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top