0

我正在尝试使用预加载器来加载 swf 文件并不断收到此错误消息。

TypeError: Error #1010: A term is undefined and has no properties.
at mpb_animated_rotator_fla::mc_main_holder_16/frame1()[mpb_animated_rotator_fla.mc_main_holder_16::frame1:36]
at flash.display::MovieClip/gotoAndStop()
at mpb_animated_rotator_fla::mc_starter_holder_1/frame10()[mpb_animated_rotator_fla.mc_starter_holder_1::frame10:1]

主文件中的movieclips 已被导出以通过actionscript 访问。我是 as3 的新手,需要帮助。

预加载器代码

import flash.display.*;
import flash.events.*;
var myContent:URLRequest = new URLRequest("mpb_animated_rotator.swf");
var myLoader:Loader = new Loader();
var eContent_mc:MovieClip = new MovieClip(); 


myLoader.load(myContent);


myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);



function loadComplete(e:Event):void
{
myLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadComplete);
guiding_loader.addEventListener(Event.ENTER_FRAME, loadingF);
function loadingF(e:Event):void{
    if (guiding_loader.ocean.currentFrame > 200){
        eContent_mc = MovieClip(myLoader.content);
        gotoAndStop(2);
        guiding_loader.removeEventListener(Event.ENTER_FRAME, loadingF);
    }
}

}

主文件代码

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.events.Event;
import flash.display.MovieClip;

var guiding:mc_guiding_complete = new mc_guiding_complete;
var innovation:mc_innovation_complete = new mc_innovation_complete;
var game:mc_game_change = new mc_game_change;
var yourb:mc_your_business_complete = new mc_your_business_complete;


addChild(guiding);
guiding.x = -215.20;
guiding.y = 230.25;
guiding.alpha = 0;
addChild(yourb);
yourb.x = 378;
yourb.y = 181;
yourb.alpha = 0;
addChild(game);
game.x = 377.95;
game.y = 181;
game.alpha = 0;
addChild(innovation);
innovation.x = 371.40;
innovation.y = 181;
innovation.innovate.gotoAndPlay(2);


innovation.innovate.addEventListener(Event.ENTER_FRAME, movetoGame);
game.chess.addEventListener(Event.ENTER_FRAME, movetoYourb);
yourb.industry.addEventListener(Event.ENTER_FRAME, movetoGuiding);
guiding.ocean.addEventListener(Event.ENTER_FRAME, movetoInnovation);

guiding.menu1.innovate_btn.addEventListener(MouseEvent.CLICK, m1innovateClick);
guiding.menu1.game_btn.addEventListener(MouseEvent.CLICK, m1gameClick);
guiding.menu1.yourb_btn.addEventListener(MouseEvent.CLICK, m1yourbClick);
innovation.menu2.ocean_btn.addEventListener(MouseEvent.CLICK, m2oceanClick);
innovation.menu2.game_btn.addEventListener(MouseEvent.CLICK, m2gameClick);
innovation.menu2.yourb_btn.addEventListener(MouseEvent.CLICK, m2yourbClick);
game.menu3.ocean_btn.addEventListener(MouseEvent.CLICK, m3oceanClick);
game.menu3.innovate_btn.addEventListener(MouseEvent.CLICK, m3innovateClick);
game.menu3.yourb_btn.addEventListener(MouseEvent.CLICK, m3yourbClick);
yourb.menu4.ocean_btn.addEventListener(MouseEvent.CLICK, m4oceanClick);
yourb.menu4.innovate_btn.addEventListener(MouseEvent.CLICK, m4innovateClick);
yourb.menu4.game_btn.addEventListener(MouseEvent.CLICK, m4gameClick);

function m1innovateClick(event:MouseEvent):void {
var guidingout2Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 1, 0, 1, true);
var innovationin2Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 0, 1, 1, true);
innovationin2Tween.addEventListener(TweenEvent.MOTION_FINISH, innovate2Play);
function innovate2Play (event:TweenEvent):void{
    innovation.innovate.gotoAndPlay(2);
    guiding.ocean.gotoAndStop(1);
    setChildIndex(innovation,4);
    setChildIndex(guiding,1);
    setChildIndex(yourb,2);
    setChildIndex(game,3);
}
}

function m1gameClick(event:MouseEvent):void {
var guidingout3Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 1, 0, 1, true);
var gamein2Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 0, 1, 1, true);
gamein2Tween.addEventListener(TweenEvent.MOTION_FINISH, game2Play);
function game2Play (event:TweenEvent):void{
    game.chess.gotoAndPlay(2);
    guiding.ocean.gotoAndStop(1);
    setChildIndex(innovation,1);
    setChildIndex(guiding,2);
    setChildIndex(yourb,3);
    setChildIndex(game,4);
}
}

function m1yourbClick(event:MouseEvent):void {
var guidingout4Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 1, 0, 1, true);
var yourbin2Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 0, 1, 1, true);
yourbin2Tween.addEventListener(TweenEvent.MOTION_FINISH, yourb2Play);
function yourb2Play (event:TweenEvent):void{
    guiding.ocean.gotoAndStop(1);
    yourb.industry.gotoAndPlay(2);
    setChildIndex(innovation,2);
    setChildIndex(guiding,3);
    setChildIndex(yourb,4);
    setChildIndex(game,1);
}
}

function m2oceanClick(event:MouseEvent):void {
var innovationout2Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 1, 0, 1, true);
var guidingin2Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 0, 1, 1, true);
guiding.ocean.gotoAndPlay(2);
guidingin2Tween.addEventListener(TweenEvent.MOTION_FINISH, guiding2Play);
function guiding2Play (event:TweenEvent):void{
    innovation.innovate.gotoAndStop(1);
    setChildIndex(innovation,3);
    setChildIndex(guiding,4);
    setChildIndex(yourb,1);
    setChildIndex(game,2);
}
}

function m2gameClick(event:MouseEvent):void {
var innovationout3Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 1, 0, 1, true);
var gamein3Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 0, 1, 1, true);
gamein3Tween.addEventListener(TweenEvent.MOTION_FINISH, game3Play);
function game3Play (event:TweenEvent):void{
    game.chess.gotoAndPlay(2);
    innovation.innovate.gotoAndStop(1);
    setChildIndex(innovation,1);
    setChildIndex(guiding,2);
    setChildIndex(yourb,3);
    setChildIndex(game,4);
}
}

function m2yourbClick(event:MouseEvent):void {
var innovationout4Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 1, 0, 1, true);
var yourbin3Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 0, 1, 1, true);
yourbin3Tween.addEventListener(TweenEvent.MOTION_FINISH, yourb3Play);
function yourb3Play (event:TweenEvent):void{
    innovation.innovate.gotoAndStop(1);
    yourb.industry.gotoAndPlay(2);
    setChildIndex(innovation,2);
    setChildIndex(guiding,3);
    setChildIndex(yourb,4);
    setChildIndex(game,1);
}
}

function m3oceanClick(event:MouseEvent):void {
var gameout2Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 1, 0, 1, true);
var guidingin3Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 0, 1, 1, true);
guiding.ocean.gotoAndPlay(2);
guidingin3Tween.addEventListener(TweenEvent.MOTION_FINISH, guiding3Play);
function guiding3Play (event:TweenEvent):void{
    game.chess..gotoAndStop(1);
    setChildIndex(innovation,3);
    setChildIndex(guiding,4);
    setChildIndex(yourb,1);
    setChildIndex(game,2);
}
}

function m3innovateClick(event:MouseEvent):void {
var gameout3Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 1, 0, 1, true);
var innovationin3Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 0, 1, 1, true);
innovationin3Tween.addEventListener(TweenEvent.MOTION_FINISH, innovation3Play);
function innovation3Play (event:TweenEvent):void{
    game.chess.gotoAndStop(1);
    innovation.innovate.gotoAndPlay(2);
    setChildIndex(innovation,4);
    setChildIndex(guiding,1);
    setChildIndex(yourb,2);
    setChildIndex(game,3);
}
}

function m3yourbClick(event:MouseEvent):void {
var gameout4Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 1, 0, 1, true);
var yourbin4Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 0, 1, 1, true);
yourbin4Tween.addEventListener(TweenEvent.MOTION_FINISH, yourb4Play);
function yourb4Play (event:TweenEvent):void{
    game.chess..gotoAndStop(1);
    yourb.industry.gotoAndPlay(2);
    setChildIndex(innovation,2);
    setChildIndex(guiding,3);
    setChildIndex(yourb,4);
    setChildIndex(game,1);
}
}

function m4oceanClick(event:MouseEvent):void {
var yourbout2Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 1, 0, 1, true);
var guidingin4Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 0, 1, 1, true);
guiding.ocean.gotoAndPlay(2);
guidingin4Tween.addEventListener(TweenEvent.MOTION_FINISH, guiding4Play);
function guiding4Play (event:TweenEvent):void{
    yourb.industry.gotoAndStop(1);
    setChildIndex(innovation,3);
    setChildIndex(guiding,4);
    setChildIndex(yourb,1);
    setChildIndex(game,2);
}
}

function m4innovateClick(event:MouseEvent):void {
var yourbout3Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 1, 0, 1, true);
var innovationin4Tween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 0, 1, 1, true);
innovationin4Tween.addEventListener(TweenEvent.MOTION_FINISH, innovation4Play);
function innovation4Play (event:TweenEvent):void{
    yourb.industry.gotoAndStop(1);
    innovation.innovate.gotoAndPlay(2);
    setChildIndex(innovation,4);
    setChildIndex(guiding,1);
    setChildIndex(yourb,2);
    setChildIndex(game,3);
}
}

function m4gameClick(event:MouseEvent):void {
var yourbout4Tween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 1, 0, 1, true);
var gamein4Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 0, 1, 1, true);
gamein4Tween.addEventListener(TweenEvent.MOTION_FINISH, game4Play);
function game4Play (event:TweenEvent):void{
    yourb.industry.gotoAndStop(1);
    game.chess.gotoAndPlay(2);
    setChildIndex(innovation,1);
    setChildIndex(guiding,2);
    setChildIndex(yourb,3);
    setChildIndex(game,4);
}
}

function movetoGame(event:Event):void{
if(innovation.innovate.currentFrame == 200){
    var innovationoutTween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 1, 0, 1, true);
    var gameinTween:Tween = new Tween(game, "alpha", Strong.easeOut, 0, 1, 1, true);
    gameinTween.addEventListener(TweenEvent.MOTION_FINISH, gamePlay);
    function gamePlay (event:TweenEvent):void{
        game.chess.gotoAndPlay(2);
        setChildIndex(innovation,1);
        setChildIndex(guiding,2);
        setChildIndex(yourb,3);
        setChildIndex(game,4);
    }
}
}

function movetoYourb(event:Event):void{
if(game.chess.currentFrame == 200){
    var gameoutTween:Tween = new Tween(game, "alpha", Strong.easeOut, 1, 0, 1, true);
    var yourbinTween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 0, 1, 1, true);
    yourbinTween.addEventListener(TweenEvent.MOTION_FINISH, yourbPlay);
    function yourbPlay (event:TweenEvent):void{
        yourb.industry.gotoAndPlay(2);
        setChildIndex(innovation,2);
        setChildIndex(guiding,3);
        setChildIndex(yourb,4);
        setChildIndex(game,1);
    }
}
}

function movetoGuiding(event:Event):void{
if(yourb.industry.currentFrame == 200){
    var yourboutTween:Tween = new Tween(yourb, "alpha", Strong.easeOut, 1, 0, 1, true);
    var guidinginTween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 0, 1, 1, true);
    guiding.ocean.gotoAndPlay(2);
    guidinginTween.addEventListener(TweenEvent.MOTION_FINISH, guidingPlay);
    function guidingPlay (event:TweenEvent):void{
        setChildIndex(innovation,3);
        setChildIndex(guiding,4);
        setChildIndex(yourb,1);
        setChildIndex(game,2);
    }
}
}

function movetoInnovation(event:Event):void{
if(guiding.ocean.currentFrame == 200){
    var guidingoutTween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 1, 0, 1, true);
    var innovationinTween:Tween = new Tween(innovation, "alpha", Strong.easeOut, 0, 1, 1, true);
    innovationinTween.addEventListener(TweenEvent.MOTION_FINISH, innovationPlay);
    function innovationPlay (event:TweenEvent):void{
        innovation.innovate.gotoAndPlay(2);
        setChildIndex(innovation,4);
        setChildIndex(guiding,1);
        setChildIndex(yourb,2);
        setChildIndex(game,3);
    }
}
}

主文件本身没有问题。

4

1 回答 1

1

首先检查加载的 swf 的 FLA 库中的符号 mc_main_holder 发生了什么。堆栈跟踪清楚地表明您正在尝试访问该符号第一帧中未定义变量的属性:

TypeError: Error #1010: A term is undefined and has no properties.
at mpb_animated_rotator_fla::mc_main_holder_16/frame1()  

堆栈跟踪继续说,在 mc_starter_holder 符号的第 10 帧中,您正在尝试播放 mc_main_holder 的第 1 帧,这就是它卡住的地方:

at mpb_animated_rotator_fla::mc_starter_holder_1/frame10()

您可以在此处阅读有关解释堆栈跟踪和理解错误的更多信息。

另外,并且不相关,我注意到您有语法错误:

function m3oceanClick(event:MouseEvent):void {
var gameout2Tween:Tween = new Tween(game, "alpha", Strong.easeOut, 1, 0, 1, true);
var guidingin3Tween:Tween = new Tween(guiding, "alpha", Strong.easeOut, 0, 1, 1, true);
guiding.ocean.gotoAndPlay(2);
guidingin3Tween.addEventListener(TweenEvent.MOTION_FINISH, guiding3Play);
function guiding3Play (event:TweenEvent):void{
    game.chess..gotoAndStop(1);
    setChildIndex(innovation,3);
    setChildIndex(guiding,4);
    setChildIndex(yourb,1);
    setChildIndex(game,2);
}
}

第 7 行下写着“game.chess..gotoAndStop(1);”。你有一个双..那里。

祝你好运!

于 2012-09-29T21:51:42.943 回答