Bring loaded external swf to the front
Hi,
I am now implementing to create a website using side scrolling platform game approach. Since the player/actor (character that moves according to keyborad events) should always be at the top layer, I am having difficulties to get my loaded swf on top of the player. I am currently using Flash cs6 (as3).
Basically, in my main stage, there are 3 layers. 1 for actionscript, the scond one for player and lastly for background.
Layer player contains player mc and background mc.
Background mc contains visual and collisions layers.
Anything that got to do with visual, i have to put it in visual layer.
In visual layer i have backgroundcontainer mc
So, as i put the button in the backgroundcontainer mc to call the external swf, the loaded external swf appears in the container.
(I am using load/unload snippet code to call the external swf)
I want the external swf to appear on top of the player.
---------------------------------------------------------------------------------------------
for (var fl_ChildIndex_2:int = 0;
fl_ChildIndex_2 < this.numChildren;
fl_ChildIndex_2++)
{
this.getChildAt(fl_ChildIndex_2).addEventListener(MouseEvent.CLICK, fl_ClickToBringToFront_2);
}
function fl_ClickToBringToFront_2(event:MouseEvent):void
{
this.addChild(event.currentTarget as DisplayObject);
}
---------------------------------------------------------------------------------------------
Any help would greatly appreciated ![]()
