1

I have a Flash file (a website header with 5 buttons for 5 links to webpages). On my actions layer, I added an external SWF file using the addChild object.

Note that I have very basic knowledge of ActionScript and I had to take some help from Google to setup above script.

The external SWF I have brought in using adChild code is working as an overlay on top of my original flash animation but all the buttons I have on original Flash file as website links have now become disabled. Even the mouseOver effects I applied to those 5 buttons are not responding. Below is my AS3 code:

    import flash.net.navigateToURL;
    import flash.net.URLRequest;


    stop();

    var swfRequest:URLRequest = new URLRequest("movie/txtOverlay.swf");
    var swfLoader:Loader = new Loader();

    swfLoader.load(swfRequest);
    addChild(swfLoader);

    button_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
    {
    navigateToURL(new URLRequest("http://www.example.com/link1.asp"),  "_self");
    }

For the sake of brevity, I have placed just one button's code but you get the idea. Any solution to avoid this? Thanks ... Syed

SmIqbal
  • 99
  • 1
  • 13
  • likely your overlay is receiving the mouse events instead of your buttons. Try `swfLoader.mouseChildren = false;` and `swfLoader.mouseEnabled = false;` and see if that fixes it. Or does your overlay need the mouse input? – BadFeelingAboutThis May 20 '16 at 21:06
  • BadFeelingAboutThis my friend your suggestion has resolved my problem. Thank you very much. I really appreciate your prompt support. However, may be in future, I am confronted by a challenge where I need mouse input for the addChild object also, so in that case what should we do to accomplish this? Thanks again in advance. – SmIqbal May 21 '16 at 04:39
  • You would need to set up your overlay so it doesn't have transparent areas that appear over top your other stuff. You can do this with masks or a few other ways. – BadFeelingAboutThis May 21 '16 at 16:26
  • Thanks again for your help. I will give it a try sometime for sure. – SmIqbal May 21 '16 at 20:48

0 Answers0