stop();
var numOfItems=1;
var radiusX =30;
var radiusY = 75;
var centerX = Stage.width / 2;
var centerY = Stage.height / 2;
var speed = 0.05;
for(var i=0;i<numOfItems;i++)
{
var logo=this.attachMovie("logo_mc","logo_"+i,i+1);
logo.angle = i*((Math.PI*2)/numOfItems);
logo.onEnterFrame=move_function();
}
function move_function()
{
this._x = Math.cos(this.angle)*radiusX+CenterX;
this._y = Math.sin(this.angle)*radiusY+CenterY;
this.angle+= this._parent.speed;
}
I have the following code in one of the frames in my game…but for some reason the move_function() is being called only once…why is this happening, and how do i fix it?
Thanks neilmmm, it worked perfectly…but i dont understand how it worked? what is the difference with () and removing them? oh…and if i cannot use those braces, how will i pass parameters to the function?