嗯,我对这个动作内容很新。以下代码有什么问题吗?每当我导出它时,.swf电影不播放,它只显示第一帧。 if()条件在函数中是否可行?
import flash.events.MouseEvent;
play();
if(currentFrame == 138)
gotoAndStop(138);
pers_btn.addEventListener(MouseEvent.CLICK,pers);
function pers (event:MouseEvent):void
{
gotoAndPlay(161);
if(currentFrame == 220)
stop();
}
kent_btn.addEventListener(MouseEvent.CLICK,kent);
function kent (event:MouseEvent):void
{
gotoAndPlay(161);
if(currentFrame == 205)
gotoAndPlay(236);
if(currentFrame == 251)
stop();
}
lebe_btn.addEventListener(MouseEvent.CLICK,lebe);
function lebe (event:MouseEvent):void
{
gotoAndPlay(161);
if(currentFrame == 205)
gotoAndPlay(221);
if(currentFrame == 235)
stop();
}
refe_btn.addEventListener(MouseEvent.CLICK,refe);
function refe (event:MouseEvent):void
{
gotoAndPlay(161);
if(currentFrame == 205)
gotoAndPlay(252);
if(currentFrame == 265)
stop();
}
zuru_btn.addEventListener(MouseEvent.CLICK,zuru);
function zuru (event:MouseEvent):void
{
gotoAndStop(138)
}
答案 0 :(得分:0)
嗯,这是代码中的一个明显问题:
if(currentFrame == 138)
gotoAndStop(138);
你需要花括号:
if(currentFrame == 138){
gotoAndStop(138);
}
干杯, DrakeSwartzy
答案 1 :(得分:0)