FORUMS: list search recent posts

addChild related issue

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Syed Iqbal
addChild related issue
on May 19, 2016 at 9:36:45 pm
Last Edited By Syed Iqbal on May 19, 2016 at 10:04:53 pm

I had a master banner and on top it 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 overlay animation works fine but all the buttons I had working fine before adding this addChild script have now become disabled.

Any solution to avoid this? Below is code I am using.


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.mySite.com/link1.asp"), "_self");
}

button_2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);

function fl_MouseClickHandler_2(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.mySite.com/link2.asp"), "_self");
}

button_3.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3);

function fl_MouseClickHandler_3(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.mySite.com/link3.asp"), "_self");

}


button_4.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_5);

function fl_MouseClickHandler_5(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.mySite.com/link4.asp"), "_self");
}


button_5.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_6);

function fl_MouseClickHandler_6(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.mySite.com/link5.asp"), "_self");

}


Return to posts index

Syed Iqbal
Re: addChild related issue
on May 20, 2016 at 3:06:52 pm

I am wondering as to why I have not received any response to my question. Can someone help me on this? Please.


Return to posts index

Kalle Kannisto
Re: addChild related issue
on May 29, 2016 at 7:15:23 am

As far as I can tell, the problem is that you're loading another swf on top of the existing one with buttons, so it is the top movieclip that receives the mouse click actions, rather than your original swf with the buttons. It does that even if the movielcip is transparent in those areas.

You'd need to modify this so that the new swf doesn't overlay the buttons. Basically you'd need a movieclip placeholder that is in a more constrained area that doesn't cover the area with the buttons and load the new clip into that. You can set the movieclip holder dimensions and location in Actionscript.


Return to posts index


Syed Iqbal
Re: addChild related issue
on May 29, 2016 at 9:01:40 am

Hi Kalle,
Thanks for your response. One more question, can you tell me if the same AS3 code I have used in Flash CS6 can also be applied to Swish Max 4?

The only reason I used an overlay of text effects made in Swish Max is that Swish Max has tons of advanced text animations which are almost impossible to accomplish in Flash CS6, at least for a person like me.

Does that make sense?

Kind regards
Syed


Return to posts index

Kalle Kannisto
Re: addChild related issue
on May 29, 2016 at 5:55:37 pm

Sorry, can't help you there, I'm not familiar with Swish Max.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]