Flash CS5:导出的 swf 无法播放 [AS 3.0]



好吧,我对这个动作脚本的东西真的很陌生。下面的代码有什么问题吗?每当我导出它时,.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)
}

好吧,这是您的代码中的一个明显问题:

if(currentFrame == 138)
gotoAndStop(138);

您需要大括号:

if(currentFrame == 138){
gotoAndStop(138);
}

干杯德雷克·斯沃兹

哦,对了,谢谢。 SWF仍然无法正常工作。还有什么建议吗?

最新更新