When adding a listener to loading content for complete how do I retain the name or id of that loaded content? Basically I’m loading an image or swf and I want text to load over top, but I need the width and height of the loaded content so I can resize the text box. So I need to wait until it’s loaded to ascertain the width and the height, but contentLoaderInfo doesn’t pass the target info to the function. So what the eff?
Also, I’m assigning the load_menu a name, but is there an id or some reference I can retain to remove this from the stage at a later time? I’m new to AS3 so this is all very confusing for me.
var load_menu:Loader = new Loader();
load_menu.x = x;
load_menu.y = y;
load_menu.name = menus[j].name();
load_menu.load(load_file);
addChild( load_menu );
//---------------------------------------------//
//
// Add an onLoad handler to resize the text
//
//---------------------------------------------//
load_menu.contentLoaderInfo.addEventListener(Event.COMPLETE,
function(event:Event):void {
------> What the heck goes here? <----
}
);
//---------------------------------------------//