Archive for October, 2008

FLVPlayback: Handling “Error opening URL”, Connection errors

Thursday, October 16th, 2008

I always had a problem catching file not found errors with Flash. Mainly the FLVPlayback player trying to load a file that do not exists.

Here’s how you can handle it for FLVPlayback for AS2:

import mx.video.FLVPlayback;
myFLVPlayer.addEventListener("stateChange",this);
myFLVPlayer.load("youvideofile.flv");

function stateChange() :Void {
if(myFLVPlayer.state == FLVPlayback.CONNECTION_ERROR)
//show error message
}