Hi team,
I have some proLoader code that works on one FLA file and I am trying to reuse the code on another file to pull in the exact same .swf in the same location and I am getting this error..
What do you reckon is going on?
Cheers
sub
Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
at flash.display::LoaderInfo/get loader()
at fl.display::ProLoader/get realLoader()
at fl.display::ProLoaderInfo()
at fl.display::ProLoader()
at aavar/WB_load()[aavar::frame1:73]
Here is my code,
WB.addEventListener(MouseEvent.CLICK, WB_load);
function WB_load(event:MouseEvent):void
{
dictionaryhome.visible=true;
alwayshome.visible=false;
WB.visible=false;
wb_ProLoader = new ProLoader();
wb_ProLoader.load(new URLRequest("SB_wordbook.swf"));
addChild(wb_ProLoader);
}
dictionaryhome.addEventListener(MouseEvent.CLICK, WB_unload);
function WB_unload(event:MouseEvent):void{
wb_ProLoader.unloadAndStop();
removeChild(wb_ProLoader);
wb_ProLoader = null;
dictionaryhome.visible=false;
alwayshome.visible=true;
WB.visible=true;
}
Cheers Kglad
yes I am using CS5.5
yes the .swf was created in the same and it is an as3 file
line 73 of code only has a } bracket
The code was working perfectly until I accidently deleted the button that activated it, then when I put it back and replaced the instance name it died.
I have worked around the problem by rebuilding my document class, but I would like to understand the problem so it doesnt come back to bite me later.
Cheers
sub (working late on the weekend!)
if you were trying to unloadAndStop() your loader before loading was complete, you'll get that error message. there are many ways to prevent that including:
function WB_unload(event:MouseEvent):void{
if(wb_ProLoader.content){
wb_ProLoader.unloadAndStop();
removeChild(wb_ProLoader);
wb_ProLoader = null;
dictionaryhome.visible=false;
alwayshome.visible=true;
WB.visible=true;
} else {
// you can use the close() method if loading is in-progress. ie, if WB has been clicked and this else-branch executes
}
}
North America
Europe, Middle East and Africa
Asia Pacific