あなたが送ってくれた最後のコードを実装しました - どうもありがとう!! これは、このフレームの完全なコンテキストであり、問題の原因となっている場合に備えて、他のボタンを含む完全なコードです。このコードで発生する 19 個のエラーは次のとおりです。
1120: 未定義のプロパティ fl_ProLoader_01 へのアクセス
stop();
//home button
mythbutt_home.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_01_1,false,0,true);
function fl_ClickToLoadUnloadSWF_01_1(event:MouseEvent):void
{
removeChild(fl_ProLoader_01);
fl_ProLoader_01.unloadAndStop();
fl_ProLoader_01 = null;
}
mythbutt_home.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_01_1,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_1(event:MouseEvent):void
{
removeChild(fl_ProLoader_01);
}
mythbutt_home.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds_01_1,false,0,true);
function fl_ClickToStopAllSounds_01_1(event:MouseEvent):void
{
SoundMixer.stopAll();
}
mythbutt_home.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_01_2,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_2(event:MouseEvent):void
{
gotoAndStop(1);
}
//other buttons at the bottom
mythbutt_aboriginal_culture.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_01_1);
function fl_ClickToGoToWebPage_01_1(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.bigmyth.com/fullversion/password033/download/ABORIGINAL_CULTURE.pdf"), "_blank");
}
mythbutt_aboriginal_pantheon.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_01_2);
function fl_ClickToGoToWebPage_01_2(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.bigmyth.com/fullversion/password033/download/ABORIGINAL_PANTHEON.pdf"), "_blank");
}
mythbutt_aboriginal_exercises.addEventListener( MouseEvent.CLICK, fl_ClickToGoToWebPage_01_3);
function fl_ClickToGoToWebPage_01_3(event:MouseEvent):void
{
navigateToURL(new URLRequest( "http://www.bigmyth.com/fullversion/password033/download/ABORIGINAL_EXERCISES.pdf"), "_blank");
}
//start button
//Change your event handler function.
start_button_aboriginal.addEventListener(MouseEvent.CLICK,fl_ClickToLoadSWF_01_2);
function fl_ClickToLoadSWF_01_2(event:MouseEvent):void {
fl_ProLoader_01=new ProLoader ;
fl_ProLoader_01.load(new URLRequest("myths/myth_aboriginal.swf"));
fl_ProLoader_01.contentLoaderInfo.addEventListener(Event.COMPLETE,
//Using closure callback instead of *onComplete_1* function
function( e : Event ) {
e.currentTarget.content.addEventListener( Event.ENTER_FRAME, OEF_01);
});
addChild(fl_ProLoader_01);
fl_ProLoader_01.x=323;
fl_ProLoader_01.y=41;
//Swap the event handlers,no need for flag,clear code blocks
start_button_aboriginal.removeEventListener(MouseEvent.CLICK,fl_ClickToLoadSWF_01_2);
start_button_aboriginal.addEventListener(MouseEvent.CLICK,fl_ClickToUnLoadSWF_01_2);
}
function fl_ClickToUnLoadSWF_01_2(event:MouseEvent):void {
fl_ProLoader_01.removeEventListener(Event.ENTER_FRAME,OEF_01);
removeChild(fl_ProLoader_01);
fl_ProLoader_01.unloadAndStop();
fl_ProLoader_01=null;
start_button_aboriginal.removeEventListener(MouseEvent.CLICK,fl_ClickToUnLoadSWF_01_2);
}
function OEF_01(e:Event):void {
if (e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
e.currentTarget.stop();
fl_ClickToUnLoadSWF_01_2(null);
}
}