如果 frame = X 返回到 frame 1
If frame = X go back to frame 1
你好,我正在制作一个动画,当它到达某个帧时,它会回到 0。
所以基本上
stop();
button_2.addEventListener(MouseEvent.MOUSE_DOWN, Animation);
function Animation(event:MouseEvent):void
{
gotoAndPlay(2);
if(currentFrame==150){
gotoAndStop(1)
}
}
stop();
button_1.addEventListener(MouseEvent.MOUSE_DOWN, Graph);
function Graph(event:MouseEvent):void
{
gotoAndPlay(300);
}
if(currentFrame==5){
gotoAndPlay(1)
}
即使您的工作不直接涉及动作脚本编码,对 as3 了解最少也会大有裨益。我强烈建议初学者阅读 Rich Shupe 的 Learning ActionScipt 3.0。
另外,下次一定要弄清楚你想问的问题。
更新:
将此代码放在 frame1 上:
stop();
stage.addEventListener(MouseEvent.CLICK,playAnimation);
function playAnimation(e:MouseEvent){
play();
}
最后一帧动画的代码:
gotoAndPlay(1);
你好,我正在制作一个动画,当它到达某个帧时,它会回到 0。
所以基本上
stop();
button_2.addEventListener(MouseEvent.MOUSE_DOWN, Animation);
function Animation(event:MouseEvent):void
{
gotoAndPlay(2);
if(currentFrame==150){
gotoAndStop(1)
}
}
stop();
button_1.addEventListener(MouseEvent.MOUSE_DOWN, Graph);
function Graph(event:MouseEvent):void
{
gotoAndPlay(300);
}
if(currentFrame==5){
gotoAndPlay(1)
}
即使您的工作不直接涉及动作脚本编码,对 as3 了解最少也会大有裨益。我强烈建议初学者阅读 Rich Shupe 的 Learning ActionScipt 3.0。
另外,下次一定要弄清楚你想问的问题。
更新:
将此代码放在 frame1 上:
stop();
stage.addEventListener(MouseEvent.CLICK,playAnimation);
function playAnimation(e:MouseEvent){
play();
}
最后一帧动画的代码:
gotoAndPlay(1);