I am developing for flash player 6 environment and I need
error trapping code similar to mclListener.onLoadError (which works
for flash player 7 and beyond).
my project loads external audio files (that are swfs) and
until those swfs are available (they are not made yet) I want an
alternate script to load a generic audio file in their place so I
know that everything is working and don't have to wait for the
audio to be made by other members of my team.
once the actual audio is available, the exact same code will
play that, without having to go in and recode everything.
So, I'm looking for listener code or whatever to load an
alternate swf when the actual one is not found.
As far as I know there really isn't a sweet way to do this.
You can make a repeating function that checks and after some amount
of no progress it assumes that nothing is coming and will do what
I also remember reading about some ideas regarding the XML
class which doesn't care if the code you are actually loading is
XML and does have an onLoad event. So you could try loading the
swfs with XML and if successful reload with loadMovie the correct
file and if not successful load the stand in file. In theory it
wouldn't slow down the deployed version too much since the first
XML "fake" load would put the file into the user's cache, but ...
it seems risky.
A better approach to using fake files might be to either have
an XML of the external sources and just keep that updated or
perhaps just place duplicate copies of your test swf and replace
them as new content comes in.