PDA

View Full Version : array into to btn



outback
February 17th, 2009, 11:23 AM
Hi guys,

please anyone!!
how can I turn the thumbs into btn...



var fotos:Array= ["imgsP/01p.jpg","imgsP/02p.jpg","imgsP/03p.jpg","imgsP/04p.jpg","imgsP/05p.jpg","imgsP/06p.jpg","imgsP/07p.jpg","imgsP/08p.jpg"]

for(var i:Number=0; i<=7; i++){
var thumb:Loader = new Loader();
thumb.load(new URLRequest(fotos[i]));
addChild(thumb);
thumb.x = 610
thumb.y = 6 +(55 * i)
}

I tried

[CODE]
thumb.buttonMode=true
[CODE]

did not work :(

thks

Magik5
February 17th, 2009, 12:11 PM
a quick look at the livedocs tells you Loader instances dont have a buttonMode property.

sprites however, do.

so if you did




var s:Sprite = new Sprite();
s.addChild(thumb);
s.buttonMode = true;
s.x = 610;
s.y = 55*i;


etc, you should get the effect you need =]