Flash 当movieclip移动到下一个关键帧as3时,动画无法正常工作

Flash 当movieclip移动到下一个关键帧as3时,动画无法正常工作,flash,actionscript-3,Flash,Actionscript 3,默认情况下,我在主时间轴的第一帧上有两个电影剪辑。以及前两部电影的动作脚本代码。它们保存在每一层上。它们工作得很好,但当我在主时间线上将所有三个关键帧从第一帧移到第二帧时。它不能正常工作。我之所以将它们移动到下一个关键帧,是因为我不想在第一帧上插入预加载程序。这是我得到的输出信息: at Flashphotographygallerywebsite10_fla::MainTimeline/frame2() at flash.display::Sprite/construct

默认情况下,我在主时间轴的第一帧上有两个电影剪辑。以及前两部电影的动作脚本代码。它们保存在每一层上。它们工作得很好,但当我在主时间线上将所有三个关键帧从第一帧移到第二帧时。它不能正常工作。我之所以将它们移动到下一个关键帧,是因为我不想在第一帧上插入预加载程序。这是我得到的输出信息:

 at Flashphotographygallerywebsite10_fla::MainTimeline/frame2()
          at flash.display::Sprite/constructChildren()
          at flash.display::Sprite()
          at flash.display::MovieClip()
          at flash.display::Sprite/constructChildren()
          at flash.display::Sprite()
          at flash.display::MovieClip()
          at Flashphotographygallerywebsite10_fla::envolop_3()
以下是actionscript代码:

/*Re-sizeable background*/
//set stage for FBF
stage.align = "TL";
stage.scaleMode = "noScale";


//define dynamic aspect ratios
var bg_mainHeight = bg_main.height / bg_main.width;
var bg_mainWidth = bg_main.width / bg_main.height;


//add event listener to the stage
stage.addEventListener(Event.RESIZE, sizeListener);


//conditional statement to account for various initial browswer sizes and proportions
function scaleProportional():void {
          if ((stage.stageHeight / stage.stageWidth) < bg_mainHeight) {
                    bg_main.width = stage.stageWidth;
                    bg_main.height = bg_mainHeight * bg_main.width;
          } else {
                    bg_main.height = stage.stageHeight;
                    bg_main.width = bg_mainWidth * bg_main.height;
          };
}


//center bg_mainture on stage
function centerbg_main():void {
          bg_main.x = stage.stageWidth / 1000;
          bg_main.y = stage.stageHeight / 1000;
}


// make listener change bg_mainture size and center bg_mainture on browser resize
function sizeListener(e:Event):void {
          scaleProportional();
          centerbg_main();
}


//run initial locations and size
scaleProportional();
centerbg_main();




/*envelope align to center*/
function resizeHandler(e:Event):void
{
  envelope_mc.x = (envelope_mc.stage.stageWidth / 2) - (envelope_mc.width / 1.15);
  envelope_mc.y = (envelope_mc.stage.stageHeight / 2) - (envelope_mc.height / 1.15);
}

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);

stage.dispatchEvent(new Event(Event.RESIZE));



stop();
/*重新调整大背景*/
//为FBF做准备
stage.align=“TL”;
stage.scaleMode=“noScale”;
//定义动态纵横比
变量bg_main height=bg_main.height/bg_main.width;
变量bg_mainWidth=bg_main.width/bg_main.height;
//将事件侦听器添加到阶段
stage.addEventListener(Event.RESIZE,sizeListener);
//用于说明各种初始浏览器大小和比例的条件语句
函数scaleProportional():void{
if((舞台高度/舞台宽度)
出现此错误是因为您的第一帧为空,这意味着您在运行程序时未定义两个movieclip。确保这是问题所在的最简单方法是在第一帧使它们alpha=0,在第二帧使它们alpha=1。若并没有错误,那个么这将确认这些movieclip并没有在第一帧上定义

解决方案是在这些电影片段真正存在时,为第二个片段定义代码。或者使它们在第一帧上可见=false,以便它们始终可用。

envelope\u mc和bg\u main是否存在于该帧上?调试模式设置为:flash时的frame2:59]后的输出。flash时的display::Sprite/constructChildren()。flash时的display::Sprite()。display::MovieClip())flash.display::Sprite/constructChildren()在flash.display::Sprite()在flash.display::MovieClip()在flashphotographyGalleryWebsite 10_fla::envolop_3()我没有收到任何错误消息。