try the MXML below. The VideoDisplay control doesn't throw an ioError
event, but it does throw a stateChange event, and if there was a
connection error then the state is set to reflect this. So you need to
listen for a stateChange event and then check if the state is set to
show a connection error.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:local="*">
<mx:Script>
<![CDATA[
import mx.events.VideoEvent;
import mx.controls.videoClasses.VideoPlayer;
import mx.controls.Alert;
private function checkForIOError(event:VideoEvent):void {
if(event.state == VideoPlayer.CONNECTION_ERROR) {
Alert.show("The video file does not exist", "File
not found");
}
}
]]>
</mx:Script>
<mx:VideoDisplay source="test.flv"
stateChange="checkForIOError(event)" />
</mx:Application>
-Doug
Firdosh Tangri wrote:
Hey all,
I am trying to check if a flv file is loaded properly
into a VideoDisplay control,
I set the path
[EMAIL PROTECTED];
videoHolder_VdDisp.load();
I call the load method to load the video but how do I check if the
flv file actually exists
I tried the method I use for a URLLoader
videoHolder_VdDisp.addEventListener(IOErrorEvent.IO_ERROR,videoFileNotFound);
but i guess the VideoDisplay control doesnt work the same way.
So if the file does not exist I want to show a alert control stating that
cheers :)
firdosh