2013-02-18 71 views
0

我的Flash项目中的“环视”按钮仅在您每次点击它时才起作用。我所有的其他按钮都有相同的代码并且工作正常。这里是我的ActionScript代码:按钮只能在闪存中每隔一段时间工作

import flash.events.Event; 

escape_btn.addEventListener(MouseEvent.CLICK, pressedEscape) 
function pressedEscape(event:MouseEvent):void 
{ 
    animations.gotoAndPlay("escape"); 
} 

bio_btn.addEventListener(MouseEvent.CLICK, pressedBio); 
function pressedBio(event:MouseEvent):void 
{ 
    gotoAndStop("biography"); 
} 

home_btn.addEventListener(MouseEvent.CLICK, pressedHome); 
function pressedHome(event:MouseEvent):void 
{ 
    gotoAndStop("home"); 
} 

analysis_btn.addEventListener(MouseEvent.CLICK, pressedAnalysis); 
function pressedAnalysis(event:MouseEvent):void 
{ 
    gotoAndStop("analysis"); 
} 

lookaround_btn.addEventListener(MouseEvent.CLICK, pressedLookAround) 
function pressedLookAround(event:MouseEvent):void 
{ 
    animations.gotoAndPlay("look around"); 
} 


stop(); 

这里是我的动画时间轴的一些截屏: enter image description here enter image description here enter image description here enter image description here

+0

你发布的内容看起来很好。大概在动画的某个地方出现问题 – 2013-02-18 03:54:43

+0

我从我的时间线中添加了屏幕截图,希望这会有所帮助 – JR34 2013-02-18 05:55:59

回答

1

我怀疑问题出在同一框架上的操作为“东张西望”标签。

我猜那里有一个stop()命令;在使用gotoAndPlay时发现,如果在gotoAndPlay跳转到的帧上也有stop(),则可能会出现问题。闪光灯变得混乱,因为它被告知要玩,但也要停下来。

+0

您说的stop()与“look around”标签在同一帧中是正确的。我在“look around”标签之前添加了一个关键帧,并在其中放置了stop()命令。谢谢! – JR34 2013-02-18 14:30:44

相关问题