change the target when the swf is not available

I want to redirect the following code, when the objective is not available.

function buttonClick(event:MouseEvent):void
{
gotoAndStop (event.target.name);

(this.parent as MovieClip).myLoader.load (new URLRequest (event.target.name + ".swf"));
}

The code works fine but I have build a great site and would like to have a default swf that loads when the goal is not available. I tried different if statements when event.target.name is nothing, but were not able to get an any of them to work.

Any ideas?

Thank you. with the event listener added to the code, it works. Here is the final code:

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Fans not correctly detect when you present to the RPM

    Why my 13 "2015 MB Pro fan not totally crank when the cpu temperature is like 100ᴼ? For example my CPU Core 1 is 80ᴼC and my Core 2 CPU is 100ᴼC, my GPU Core even 78ᴼC yet the rest fan 1300 rpm, whereas at this stage at 4000-6000 RPM. Is it because I

  • How can I get rid of the pop "ads not this site" ups?

    Some web sites will have the underlined words and when I scroll over them, an ad appears. Tell you "ads not this site" and the site will not work correctly.

  • viewing deferred image or loading?

    This has probably been answered somewhere, but my search terms are not finding it, I have not only a lot of problems. I don't know yet that my logical technical description. I think that this only happened since a recent firefox update last week. I w

  • On the latest version of Mozilla FireFox

    Hi there, if I suspect that my Mozilla Firefox is already outdated. How can I check for the latest version of Mozilla Firefox and how to upgrade to the latest version? Thank you for your sincere help 1 million.

  • Portege R830 had dead blue when the screen connects to wifi or shared internet

    It seemed began as soon as the automatic update from Microsoft on Qualcomm, Atheros, every time when connect to any WIFi, share internet, my portege R830 shows blue screen and the following error message:unhandled system_thread_exception (athwb.sys)