FORUMS: list search recent posts

Flash Array Help

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Flash Array Help
on Dec 14, 2005 at 7:32:44 pm

Hi! I am trying to make a game in which 1 movie clip(character) will appear in 1 of the 3 different positions I set up on the Array randomly. Any ideas?

thank you!

Return to posts index

rene hazekamp
Re: Flash Array Help
on Dec 16, 2005 at 6:57:35 pm

Ha Kakenx

you could do it this way

var XpositionArray:Array = new Array(50,100,150); //create the list of _x positions
var Arraypointer:Number = Math.floor(Math.random()*3); // make a random pointer to a position in the array; floor for roundnumbers from 0 to 3
MyCharacter_mc._x =XpositionArray[Arraypointer]; // assign to array value to your characters X position

hope it helps

Rene Hazekamp

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved