0
呃...我试着停止在as3上编码的动画,但不能这样做。这里的代码!如何在as3上停止功能
//this make the ground move
function GroundAndEndingMove(event:Event):void
{
ground.x = ground.x - 5;
if (ground.x <= -846.24)
{
ground.x = -846.25;
ending.x = 503.5;
stop();
}
stopmation.x = stopmation.x - 5;
if (stopmation.x <= -846.24)
{
ground.x = -846.25;
ending.x = 503.5;
stop();
}
ending.x = ending.x - 5.1;
if (ending.x <= 503.5)
{
rowl.x = 548.1;
ending.x = 503.5;
stop();
}
trash.x = trash.x - 5.1;
if (trash.x <= 503.5)
{
trash.x = 503.5;
ball.x = ball.x + 5.1;
stop();
}
}
stage.addEventListener(Event.ENTER_FRAME, GroundAndEndingMove);
//this function make the ball to faled
function GameOver(event:Event):void
{
if(ball.hitTestObject(ground))
{
//here I should stop the animation wherever it be.
}
if (ball.hitTestObject(stopmation))
{
//also here
}
}
stage.addEventListener(Event.ENTER_FRAME, GameOver);
怎么办?或者你有什么更好的想法.. 帮助!
(对不起任何拼写错误......我做了很久以前,我回到它现在..)