Having nothing but errors today! It would be sooo nice to get a bit of help with this one.
I am calling external child swfs for an AIR app; SUPER SIMPLE - calling them with a button, and removing them with a "home" button, that's it. But I get these errors and I cannot publish, even a test, without crashing the entire system. Please help! I have been stuck on this, literally, for weeks!
this is the error:
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/removeChild()
at pocketDinos_fla::MainTimeline/fl_ClickToGoToAndStopAtFrame_20_1()
[pocketDinos_fla.MainTimeline::frame162:18]
Test Movie terminated.
And this is what I assume is causing the problem on the main timeline (this is ALL the code on the main timeline):
stop();
//home button
button_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;
}
button_home.addEventListener(MouseEvent.CLICK,
fl_ClickToGoToAndStopAtFrame_01_1,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_1(event:MouseEvent):void
{
removeChild(fl_ProLoader_01);
}
button_home.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds_01_1,false,0,true);
function fl_ClickToStopAllSounds_01_1(event:MouseEvent):void
{
SoundMixer.stopAll();
}
button_home.addEventListener(MouseEvent.CLICK,
fl_ClickToGoToAndStopAtFrame_01_2,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_2(event:MouseEvent):void
{
gotoAndStop("home");
}
//back to time period button
back_to_triassic.addEventListener(MouseEvent.CLICK,
fl_ClickToLoadUnloadSWF_01_2,false,0,true);
function fl_ClickToLoadUnloadSWF_01_2(event:MouseEvent):void
{
removeChild(fl_ProLoader_01);
fl_ProLoader_01.unloadAndStop();
fl_ProLoader_01 = null;
}
back_to_triassic.addEventListener(MouseEvent.CLICK,
fl_ClickToGoToAndStopAtFrame_01_3,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_3(event:MouseEvent):void
{
removeChild(fl_ProLoader_01);
}
back_to_triassic.addEventListener(MouseEvent.CLICK,
fl_ClickToStopAllSounds_01_2,false,0,true);
function fl_ClickToStopAllSounds_01_2(event:MouseEvent):void
{
SoundMixer.stopAll();
}
back_to_triassic.addEventListener(MouseEvent.CLICK,
fl_ClickToGoToAndStopAtFrame_01_4,false,0,true);
function fl_ClickToGoToAndStopAtFrame_01_4(event:MouseEvent):void
{
gotoAndStop("TRI_home");
}
//start button
start_button_TRI_coelophysis.addEventListener(MouseEvent.CLICK,
fl_ClickToLoadUnloadSWF_01_3,false,0,true);
import fl.display.ProLoader;
import flash.events.Event;
var fl_ProLoader_01:ProLoader;
function fl_ClickToLoadUnloadSWF_01_3(event:MouseEvent):void
{
if(fl_ToLoad_01)
{
fl_ProLoader_01 = new ProLoader();
fl_ProLoader_01.load(new URLRequest("dinofilms/triassic_coelophysis.swf"));
fl_ProLoader_01.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete_01)
addChild(fl_ProLoader_01);
fl_ProLoader_01.x = 0;
fl_ProLoader_01.y = 144;
}
else
{
if(fl_ProLoader_01!=null) {
removeChild(fl_ProLoader_01);
fl_ProLoader_01.unloadAndStop();
fl_ProLoader_01 = null;
}
}
fl_ToLoad_01 = !fl_ToLoad_01;
}
function onComplete_01(e:Event):void {
e.currentTarget.content.addEventListener(Event.ENTER_FRAME,OEF_01);
}
function OEF_01(e:Event):void {
if(e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
e.currentTarget.stop();
e.currentTarget.removeEventListener(Event.ENTER_FRAME,OEF_01);
removeChild(fl_ProLoader_01);
fl_ProLoader_01.unloadAndStop();
fl_ProLoader_01 = null;
}
}