 nodinosaur
|
<p>Hi, </p>
<p>I am having a slight issue, where it appears that the ‘loaded’ property in not being set correctly.</p>
<p>I am using @soundstep’s flavor of AssetLoader</p>
<p>in brief I am loading various assets, a background JPG, a few images JPG’s and an SWF.<br />
I am creating a loader for each, adding that to assetLoader using addLoader and<br />
adding event handlers to the particular loader</p>
<p>trimmed down code looks like this:<br />
Code:
<br />
[Inject]<br />
public var assetLoader : IAssetLoader;<br />
private var _pageLoader : IAssetLoader;</p>
<p>function load() : void {<br />
var loader : ILoader;<br />
_pageLoader = new AssetLoader ( model.currentPageId );<br />
_pageLoader.numConnections = 1;<br />
assetLoader.addLoader ( _pageLoader );</p>
<p>loader = new ImageLoader ( new URLRequest ( background_source ) , "BACKGROUND" );<br />
_pageLoader.addLoader ( loader );<br />
addBackgroundLoaderListeners ( loader );</p>
<p>loader = new SWFLoader ( new URLRequest ( swf_source ) , "SWF" );<br />
_pageLoader.addLoader ( loader );<br />
addSwfLoaderListeners ( loader );<br />
}<br />
</p>
<p>The listeners are added in
Code:
addBackgroundLoaderListeners()
and
Code:
addSwfLoaderListeners()
and simply dispatch events for the progress & completion.</p>
<p>When I want to access the assets again and test for assetLoader.loaded it seems to always return a false, when can see that the assets have infact all loaded.</p>
<p>I am sure I am doing something wrong here, can anyone point me in the right direction?</p>
<p>Thanks,</p>
<p>George
</p>
|
 Matan Uberstein
|
Have your tried using the ALLogger’s explode method to see if all the assets are loaded? Call the explode at the point you think everything should be loaded, then paste the response in your next reply to this thread.
Thanks!
Matan
|
 nodinosaur
|
sure , seems the SWF loader isn’t being invoked:
1
/** EDIT**/
Just realized, 1 is why the SWFLoader is not invoked, however I would assume that the SWFLoader is invoked after the previous loader is complete, however traces do not show me this
Changing it to 1 the SWFloader IS invoked and using traces I can see that the asset is Loaded
|
 Matan Uberstein
|
This is really weird behaviour, if _pageLoader has two child loaders and you invoke _pageLoader.start() with numConnections set to 1, the first loader should complete and then the second. This is something that’s unit tested, so it must work. I’ve also used numConnections set to 1 in personal projects and while testing.
Where are you calling start on your _pageLoader?
|
 nodinosaur
|
**UPDATE**
There is a BUG in SoundSteps version of the Native Event based version of AssetLoader v2.3.4
I have just updated my source to use the Signals variant and it works flawlessly
Sorry about this
|
 Matan Uberstein
|
Let me know if I can assist you with anything. I was looking through the event version’s source and I could not find anything incorrect, or at least that relates to this problem.
|
 Matan Uberstein
|
Flagging as resolved.
Problem was caused by calling event.stopImmediatePropagation() on child loaders complete events. This stopped the parent IAssetLoader from receiving the complete events, thus resulting in the loading queue to stop.
|