|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Storing arrays
Hi all,
I am having a tough time finding a solution for this. Lets say i have a randomly generated number. eg. Code:
q = Number(random(50))+1; On another frame i have a loop. eg. Code:
loop = Number(loop)+1; score = score-0; gotoAndPlay(1); Within this frame i want to store the values of "q" in an array, for example: Code:
new_q = 2,23,12,14,8 etc. The loop only lasts 10 times so i would need to store just 10. Any ideas on how i should do this? Regards, camcim |
|
#2
|
|||
|
|||
|
Hi, I've been playing with arrays lately.
randArray = new Array(); randArray.push(Number(random(50))+1); You will want to create the array outside of the loop so that you are not re-creating it each time. Array.push() |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Storing arrays |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|