Jump to content
Search Community

LoaderMax Issue with pause()

craig.murray test
Moderator Tag

Recommended Posts

I'm loading a large number of resources of all types with a single LoaderMax instance.  Several times during loading I call pause() and then resume() a second or so later.  At first it worked, but as my resource list changed, I started having failures.  There were no errors reported, I just never received a complete on the load.  

 

I found a single swf file with some audio inside that I was loading, which when removed from the load, fixed the problem.  The swf is fine, and if I simply remove the pause() and resume() calls, I can load the swf without issue.

 

One thing I noticed is that I get a report of Flash decompressing the swf file twice.  I have verified that it is only loaded once, and with pause() and resume() removed, it only decompresses once.

 

[sWF] C:\_projects\game\bin-debug\assets\swfs\Soundtrack.swf - 1,502,520 bytes after decompression

[sWF] C:\_projects\game\bin-debug\assets\swfs\Soundtrack.swf - 1,502,520 bytes after decompression

 

Is it possible that pause() and resume() are interacting with the Flash Player's swf decompression somehow?  Resuming before it's fully paused or something?

 

 

Any ideas what's going on here?

 

 

Thanks!

 

Craig

Link to comment
Share on other sites

Unfortunately, Flash has some bugs that cause problems if you cancel the load of a swf before it finishes - it can prevent it from becoming eligible for garbage collection, and sometimes cause other problems. So if you cancel a SWFLoader, it automatically allows the load to complete and then unloads it when it's safe. Again, that's for your protection. I wonder if maybe you've got some stuff in that swf that needs cleaning up before unloading. For example, if there's code inside of it that adds event listeners to the stage or starts NetStreams or something like that - it's impossible for SWFLoader to know that or clean up after that code by removing event listeners, killing NetStreams, etc. - that's something you need to do. 

 

It doesn't really explain why there are no errors reported, though. If you're saying that things are failing but LoaderMax never dispatches any kind of indication of such, and just hangs, I'd need to see a simplified set of files that we could publish on our end to see the issue. Please don't send all your production files, though - just create the simplest possible reduced test case and shoot it over to us if you'd still like to get some help.

Link to comment
Share on other sites

Thanks for your quick response Jack.  I have created a sample project that should demonstrate this issue.  All you'll need to do after importing into Flash Builder is create a sourcepath into the greensock libraries (I didn't include those to keep zip filesize down).

 

On some machines, the complete is called, on other machines it's not.  If it gets called on your machine, just play around with the append() calls, either adding or removing various ones until you reproduce the problem.

 

Not sure how to manage attachments on this site so I'm emailing the project to you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...