1
這裏是我的代碼:MouseX值更改時光標仍在
public function update()
{
//making the character follow the mouse
if(mouseX > (x + 25))
{ //if the mouse is to the right of mcMain
x += mainSpeed;//move mcMain to the right
}
else if (mouseX < (x - 25))
{//same thing with the left side
x -= mainSpeed;
}
else
{
trace(x + " and " + mouseX);
x = mouseX;//if it's close enough, then make it the same x value
}
}
對於一些未知的原因,mouseX這個對象的變化c值甚至當指針仍在(指物體閃爍)
這裏的跟蹤,當我離開光標還是:
84 and 80
80 and 84
84 and 80
80 and 84
84 and 80
80 and 84
84 and 80
mouseX沒有被我改變了(而不能因爲它的只讀),沒有這個對象,因爲我任何其他代碼我只是從這個開始項目。
謝謝。
完美!非常感謝你! – 2012-02-01 03:34:42