【发布时间】:2014-01-17 23:26:43
【问题描述】:
我有一个问题,无法弄清楚。当我测试场景时一切都很好,我添加了 stop();到我的电影剪辑时间线,一切都很好,直到没有代码添加到主舞台。一旦我开始向舞台添加代码,它就会开始循环?因此,我遇到了一个问题,甚至无法进一步开发,因为即使是鼠标单击事件也不会对该循环起作用...我要添加的代码只是单击播放按钮后一个简单的移动层离开舞台:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
introScreen.play_btn.addEventListener(MouseEvent.CLICK, clickAway);
function clickAway(event:MouseEvent):void
{
moveScreenOff(introScreen);
}
function moveScreenOff(screen:MovieClip):void
{
//Move the screen off...
var introTween = new Tween(screen,"x",Strong.easeInOut,screen.x,(screen.width)*-1,1,true);
//When the motion has finished...
introTween.addEventListener(TweenEvent.MOTION_FINISH, tweenFinish);
function tweenFinish(e:TweenEvent):void
{
trace("tweenFinish");
//Establish the game state...
gameState = STATE_INIT_GAME;
trace(gameState);
//Fire off the gameLoop function at the frame rate of the movie...
addEventListener(Event.ENTER_FRAME, gameLoop);
}
}
【问题讨论】:
-
这个职位是实习生,他们给了我一个任务来为安卓创建一个基本的 Flash 应用程序。你是什么意思问题没有信息?没有代码,因为我在开始编写它之前就想出了这个问题,所以......有闪存的链接,如果有人可以看看并尝试添加任何代码,我将非常感激,我正在添加鼠标单击事件以从介绍屏幕反弹,它不起作用,而是使电影循环。 filedropper.com/veinsv2
-
As soon as i start adding code to the stage, it starts looping?-> 请显示您尝试自己添加的代码。否则,这个问题很快就会结束,因为到目前为止它还没有表现出太多自己的努力,不幸的是。 -
请将其编辑到问题中。使用
{}代码按钮缩进它。 -
我已将代码添加到主题中。
标签: actionscript-3 flash adobe