all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

Re: Randomize xpos and ypos


Re: Randomize xpos and ypos blemmo
2/28/2006 6:08:42 PM
flash actionscript:
Hm, this code should work fine... did you place it on a frame and named the MC
instance right?

I used Math.random(), because random() is deprecated and may not work in
future versions. The randRange(min, max) function is from the Flash Help and
not really complicated... it just makes sure you get values in the range you
specify with the parameters.

Anyway, you could also use the attached code.

cheers,
blemmo





mc.onRollOver = function(){
mc._x = random(Stage.width-mc._width);
mc._y = random(Stage.height-mc._height);
}
Re: Randomize xpos and ypos makate
3/8/2006 4:34:26 PM
AddThis Social Bookmark Button