2012-09-29 53 views
0

我想使用預加載器來加載一個SWF文件,並不斷收到此錯誤消息。錯誤#1010在Flash動作3預加載器

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] 

主文件中的影片剪輯已導出,可以通過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); 
    } 
} 
} 

主文件有它自己沒有任何問題。

回答

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() 

你可以閱讀更多關於如何解釋堆棧跟蹤和理解錯誤here

而且,和不相關的,我注意到你有一個語法錯誤:

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); 
} 
} 

七號線下寫着 「game.chess..gotoAndStop(1);」。你有一個雙..在那裏。

祝你好運!

+0

非常感謝。這篇文章真的有幫助。 – jppower175