Strona 1 z 1

losowanie pozycji losowa pozycja

: pt kwie 21, 2006 10:47 pm
autor: Marek_bf
Witam.

Kod: Zaznacz cały

button_btn.onRelease = function() {
	for (var i = 1; i <= 8; i++) {
		var my_mc:MovieClip = this._parent["x" + i];
		my_mc._x = rand(0, 400 - my_mc._width);
		my_mc._y = rand(0, 400 - my_mc._height);
	}
};
function rand(rMin:Number, rMax:Number):Number {
	return Math.round(Math.random() * (rMax - rMin)) + rMin;
}