Groups | Blog | Home
all groups > flash actionscript > july 2005 >

flash actionscript : Media Playback Component Custom Error Message


Daniel.Serrano
7/22/2005 6:46:33 PM
Hi guys,

Does anyone know how to trigger an event after the Media Playback component
fails to find the specified FLV file to load?

I am trying to create a custom error message for the user, that shows only if
the video file doesn't exist.

Any help is appreciated!!!
:D
Rothrock
7/22/2005 6:55:44 PM
Daniel.Serrano
7/22/2005 7:02:56 PM
Sorry, it's the same thing...just being redundant...
Rothrock
7/22/2005 7:45:02 PM
Oh sorry. I suspected they were the same thing, but it seemed you were able to
make it work for one and not the other, so I was really confused.

I'm away from my MX04, have you checked Help?> Using Components?> Component
Dictionary ?> Media Components? Is there any kind of event handler that might
do this?

If not, there might be a sneaky way where you can first try and load the flv
as an xml or loadvars. If you get an error then you would know immediately. If
you get a progress or bytesloaded you could then maybe cancel the xml load and
proceed. Just a thought, I haven't tried it myself.
Daniel.Serrano
7/22/2005 11:27:14 PM
I've been reading all the documentation I could find for the Media Playback
component and it doesn't seem to have any event handler that returns wether the
..flv video was loaded successfully.

I also tried loading the video with LoadVars to check whether the file existed
with no luck. It seems to know that the format is different.

Thanks for the suggestions though! I'll keep looking for an answer!
Rothrock
7/23/2005 12:10:05 AM
Sorry. I was just grasping at straws. I think you might be able to find
something to work with in the Media.progress event.

I checked under Netstream.onStatus and there is an error event there. I
imagine that the media components are built upon the same base. You might want
to open up the as files that power the media components and poke around a bit.

Or sorry to say, you might want to redo the whole thing with the NetStream
class instead of using the components.

I'll keep poking around and let you know if I find anything. Please do
likewise!


Daniel.Serrano
7/23/2005 12:17:55 AM
You were right!

I gave it one last shot, changed all the file names and it finally
worked...something was funky but I'm glad I found a way, thank you so much for
the help!

Here's the explanation:
http://www.flashguru.co.uk/checking-if-a-file-exists/
AddThis Social Bookmark Button