Scott64
January 18th, 2010, 11:24 AM
Hello,
I'm using URLLoader to load my external SWFs in as a ByteArray before use so I can preload them without the possibility of them playing prematurely. It's been working great so far, but I just ran into an issue. It's not loading question pools for Captivate quizzes.
If I use Loader.load() for my quiz it works fine and the question pool loads. If I use URLLoader to get a ByteArray and then use Loader.loadBytes(), I get an error saying that it can't load the question pool. My code is below. If you comment out the urlLoader.load() line and use the loader.load() one instead, it'll work fine. Otherwise, I get an error.
Any ideas of where to look for a solution to this would be great.
var loader:Loader = new Loader();
var urlLoader:URLLoader = new URLLoader();
addChild(loader);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, done1);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, done2);
urlLoader.load(new URLRequest("AS3_Test_Quiz.swf")); //Won't load question pool
//loader.load(new URLRequest("AS3_Test_Quiz.swf")); //Will load question pool
function done1(evt:Event):void{
trace("Loaded Data");
loader.loadBytes(ByteArray(urlLoader.data));
}
function done2(evt:Event):void{
trace("SWF is now a DisplayObject");
}
Output when using URLLoader and Loader:
Loaded Data
******** CaptivateMainTimeline ********
incrementWait = 1
SWF is now a DisplayObject
>> loadListener.onLoadError() [object rdPreloader]
>> ==========================
Error: ------- Could not load pool swf -----------
at captivate.Veela_AS3::CaptivateMainTimeline/loadError()
incrementWait = 2
done frame2 false
Output when using Loader alone:
******** CaptivateMainTimeline ********
incrementWait = 1
SWF is now a DisplayObject
incrementWait = 2
done frame2 false
----------- CpPoolMaintimeline1 -----------
qpmovie.m_quizPoolData.poolname set to D1L1-Intro_PM_CRS
@@@@@@@ POOL loadStart @@@@@@@
ref [object CaptivateMainTimeline]
targetpoolSwf_mc [object MovieClip]
@@@@@@@ POOL COMPLETE @@@@@@@
cpTimeLineref [object CaptivateMainTimeline]
targetpoolSwf_mc [object MovieClip]
DONE***********
-------onQuizPoolInitialized----------- mc [object CpPoolMaintimeline1]
targetMC poolSwf_D1L1-Intro_PM_CRS_mc
mc.movie [object rdQuizPoolMovie]
mc.numChildren 6
^^^^^^^^^ addQuizPoolData quizPoolData.poolname D1L1-Intro_PM_CRS
loading_mc = [object rdPreloader]
decrementWait = 1
decrementWait = 0
Thank You!
I'm using URLLoader to load my external SWFs in as a ByteArray before use so I can preload them without the possibility of them playing prematurely. It's been working great so far, but I just ran into an issue. It's not loading question pools for Captivate quizzes.
If I use Loader.load() for my quiz it works fine and the question pool loads. If I use URLLoader to get a ByteArray and then use Loader.loadBytes(), I get an error saying that it can't load the question pool. My code is below. If you comment out the urlLoader.load() line and use the loader.load() one instead, it'll work fine. Otherwise, I get an error.
Any ideas of where to look for a solution to this would be great.
var loader:Loader = new Loader();
var urlLoader:URLLoader = new URLLoader();
addChild(loader);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, done1);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, done2);
urlLoader.load(new URLRequest("AS3_Test_Quiz.swf")); //Won't load question pool
//loader.load(new URLRequest("AS3_Test_Quiz.swf")); //Will load question pool
function done1(evt:Event):void{
trace("Loaded Data");
loader.loadBytes(ByteArray(urlLoader.data));
}
function done2(evt:Event):void{
trace("SWF is now a DisplayObject");
}
Output when using URLLoader and Loader:
Loaded Data
******** CaptivateMainTimeline ********
incrementWait = 1
SWF is now a DisplayObject
>> loadListener.onLoadError() [object rdPreloader]
>> ==========================
Error: ------- Could not load pool swf -----------
at captivate.Veela_AS3::CaptivateMainTimeline/loadError()
incrementWait = 2
done frame2 false
Output when using Loader alone:
******** CaptivateMainTimeline ********
incrementWait = 1
SWF is now a DisplayObject
incrementWait = 2
done frame2 false
----------- CpPoolMaintimeline1 -----------
qpmovie.m_quizPoolData.poolname set to D1L1-Intro_PM_CRS
@@@@@@@ POOL loadStart @@@@@@@
ref [object CaptivateMainTimeline]
targetpoolSwf_mc [object MovieClip]
@@@@@@@ POOL COMPLETE @@@@@@@
cpTimeLineref [object CaptivateMainTimeline]
targetpoolSwf_mc [object MovieClip]
DONE***********
-------onQuizPoolInitialized----------- mc [object CpPoolMaintimeline1]
targetMC poolSwf_D1L1-Intro_PM_CRS_mc
mc.movie [object rdQuizPoolMovie]
mc.numChildren 6
^^^^^^^^^ addQuizPoolData quizPoolData.poolname D1L1-Intro_PM_CRS
loading_mc = [object rdPreloader]
decrementWait = 1
decrementWait = 0
Thank You!