Store a reference to the added child in an array or associative
array(object).

_aChildren["one"] = tiletest.addChild(moduleloader);

then you can do: 
tiletest.removeChild(_aChildren["one"] );

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sailorsea21
Sent: Thursday, October 16, 2008 3:37 PM
To: [email protected]
Subject: [flexcoders] sailorsea21 - RemoveChild question.

 

Hi, 

I have a "Tile" in my application:

<mx:Tile width="100%" height="100%" id="tiletest"/> 

I also have a linkbutton that loads moduleloaders in "mx:Tile":

<mx:LinkButton label="Load" click="loadmodule()" buttonMode="true"/>

<mx:Script>
<![CDATA[
import mx.modules.ModuleLoader; 
public function loadmodule():void {
var moduleloader:ModuleLoader = new ModuleLoader();
tiletest.addChild(moduleloader);
moduleloader.url = "test.swf";
}
]]> 
</mx:Script>

I can load the module several times but my problem is: 
If I load several modules, how can I remove a specific one, let's say 
the third one that was loaded?

Do I need to add a specific remove button within the module 
application? If so, what script can I use???

Thank you.

 

Reply via email to