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

flash actionscript

group:

Scramble MC's



Scramble MC's IndioDoido
12/9/2006 10:46:31 PM
flash actionscript: Hi,

Is it possible to scrable movie clips on a stage?
Re: Scramble MC's Erick Souza
12/9/2006 10:48:18 PM
[quoted text, click to view]


It will return values from 0 to the value of Stage (width/height), you
can remove the dimension of the mc for when the maximum value be
returned and the mc stays visible.

Your_MC._x = Math.random() * (Stage.width - Your_MC._width);
Your_MC._y = Math.random() * (Stage.height - Your_MC._height);


--
Regards,
Erick Souza
Re: Scramble MC's kglad
12/9/2006 11:24:03 PM
Re: Scramble MC's Dan_pc
12/9/2006 11:25:05 PM
Try This

st_width = //stageWidth
st_height = //stageHeight

Your_MC._x = Math.random() * st_width;
Your_MC._y = Math.random() * st_height;

Hope this helps

Daniel
www.albingraphics.com
Re: Scramble MC's IndioDoido
12/10/2006 12:24:56 AM
hey!
thanks for the reply Dan
but isn't this going to send the mc off the stage?

Your_MC._x = Math.random() * st_width;
Your_MC._y = Math.random() * st_height;

AddThis Social Bookmark Button