hey guys,
I am stuck in AS3
I got a function with For loop… that created instances of a button… … now when i press one of these buttons i want to load up an image… so i used the code below to call the function when you click on the menu item.
portMenu.addEventListener(MouseEvent.CLICK, displayPort);
the for loop also includes var Title:String = mainXML…item*…IMAGE.text();
then here is the function that gets called when the button is pressed…
function displayPort(event:MouseEvent){
var ldr:Loader = new Loader();
var urlReq:URLRequest = new URLRequest(" I WANT TO INSERT IMAGE VALUE HERE ");
ldr.load(urlReq);
displayMC.addChild(ldr);
ldr.x = 20;
ldr.y = 100;
}
can anyone help thanks