PDA

View Full Version : Quick TileList Question


Laser Wave
05-27-2008, 01:49 PM
Is there any way to select 2 random tiles in a tilelist rather than having to click them? I can't seem to be able to get it working.

saravanan
05-27-2008, 03:34 PM
HI Laser what is mean by selecting 2 random tile list ...

u meant after loading the tileList component ... ???

~sara~
http://sara-intop.blogspot.com

Laser Wave
05-27-2008, 04:14 PM
So I've got my TileList and it contains objects, I just want to select 2 of those objects at random. Like this:

http://img138.imageshack.us/my.php?image=93550759bu9.gif
http://img138.imageshack.us/my.php?image=93550759bu9.gif

In that I clicked to select them, but I want to have them selected randomly.

box86rowh
05-29-2008, 03:47 PM
in your actionscript, do:

tileListName.selectedIndices = [x,y];
where x and y are your random numbers between 0 and the number of your objects minus 1.

Laser Wave
05-30-2008, 02:57 AM
in your actionscript, do:

tileListName.selectedIndices = [x,y];
where x and y are your random numbers between 0 and the number of your objects minus 1.

That's perfect, thanks! (that problem has been holding me up for ages...)