hi, i feel totally idiot trying to find how to assign listener to an object created with this function…
private function placeBtn(thumb:String, Xthumb:Number, Ythumb:Number, targetHolder:MovieClip, ID:String):void{
var clipHolder:MovieClip = new MovieClip();
clipHolder.x = Xthumb;
clipHolder.y = Ythumb;
clipHolder.nombre = ID;
var Loader1 = new Loader();
Loader1.load(new URLRequest(thumb));
Loader1.mouseEnabled = false;
clipHolder.addChild(Loader1);
targetHolder.addChild(clipHolder);
}
of course i can see it has a instance name assigned by compiler but i would like to have a way to assign one so i don’t have to figure out wich is the name compiler assign… i created clipHolder.name = ID for this purpose but don’t have a clue if it work…heeeeeeelp…
i invoque the function using this:
public function btnClick1(evt):void{
placeBtn("ThumbA1.jpg", 400, -20, PlacaInferior, "opt1A");
placeBtn("ThumbA2.jpg", 550, -20, PlacaInferior, "opt2A");
placeBtn("ThumbA3.jpg", 700, -20, PlacaInferior, "opt3A");
}
thanks a lot in advance