I have an array of buttons,that I shuffle I am then trying to place them in my button grid randomly.I tried using a for loop but just can't get it right.
I have worked in your FLa and made the buttons to randomize their positions! I have attached the Fla here (Flash 8 format).
You may check the code and if you are not able to understand it then you may put some traces and try to understand it....I have added my comments on the code:
Logic I used:
1. Record _x and _y positions of all the buttons in array
2. Create a temproray array which will hold numbers from 1 to 15
3. Randomize this array
4. As per the randomized array replace all the buttons with the co-ordinates recorded earlier
Once you see the code and read above description you will understand teh thing!
Hope this helps!
Last edited by vinayak.kadam; 05-25-2011 at 08:14 AM.