Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
kmcg101

Loading multiple images with LoaderMax crashes Flash CC Mac API

Recommended Posts

I've been testing this for days now and I've reached my conclusions.  I can consistently crash the API while previewing under the following circumstances:

 

multiple JPG images are loaded.  I'm using 5 to test:

1. A LoaderMax instance and appending to the queue using a for loop.

2. A LoaderMax instance and appending to the queue using parse() and an array of URLs that point to JPG images.

3. A singular ImageLoader instance in a for loop.

 

If I preview this file in the Flash CC for Mac API, after 5 or 10 previews, the API will crash.  If I switch to local image files, there is no crash on preview.  If I reboot it will take more previews but after it crashes once, the next crash happens in less than 10 previews.

 

Here is the code I've been using:

LoaderMax.activate([ImageLoader]);
            
var queue:LoaderMax = LoaderMax.parse(stringArray, {autoDispose: true, onComplete:completeHandler, onChildComplete:childCompleteHandler});

queue.load(); 

And the handlers:

private function childCompleteHandler(event: LoaderEvent): void {
    trace("child done")
}

private function completeHandler(event: LoaderEvent): void {
} 

Is there a memory leak in LoaderMax when loading non-local images in the api?  I haven't noticed problems in the compiled SWF, just in the api when previewing.

Link to post
Share on other sites

This is very strange, are you sure you don't have multiple frames in your timeline and perhaps the code is running over and over or something like that?

 

Will it crash a browser too, or just the Flash IDE?

 

It would really help if you could zip a very simple test that loads only 5 images. Include all assets needed to compile. We will take a look. 

Link to post
Share on other sites

Thanks for taking a look.  The only thing that crashes is the Flash IDE.  I've tested it on my work computer (2011 Macbook Pro with 8 GB memory) and my home machine (2012 MBP, 16 GB memory)

Link to post
Share on other sites

hmm I exported over 20 times, no problems.

 

I added: 

 

private function childCompleteHandler(event: LoaderEvent): void {
  addChild(event.target.content);
}
 
so that I could see the images and verify they loaded. Everything worked super smooth.
I'm using Flash CC version 13.something. Running an update. Will test again later.
 
I'm using what seems to be the same 2012 MBP as you.
 
Link to post
Share on other sites

I keep a close eye on my trace output so I'm sure it's not loading multiple times.  In error I did write infinite loops and that crashed the IDE pretty quickly too.  What I found most interesting is the loader only crashed Flash when loading files from the web.  When I switched to loading local files, it was fine.  I previewed 50 times without a crash with local files.

Link to post
Share on other sites

are you publishing or previewing?  I had a problem with previewing (command - enter).  I could publish without problem.

Link to post
Share on other sites

I just did another test.  I rebooted, published 26 times and on the last publish, Flash crashed.  I started Flash again without a reboot and it crashed on the 2nd publish.  A good way to 'prime' the crash is to put a loadThumbs() in the onComplete handler so that it runs unattended.  After 20 or so loads, stop it, remove load thumbs() in the complete handler and publish a few times for a crash.

Link to post
Share on other sites

I'm sorry, yet happy to say that I couldn't force a crash.

 

I compiled 30 times with no problems.

Then I ran the loadThumbs() onComplete thing and let that loop more than 40 times with a counter.

 

private function completeHandler(event: LoaderEvent): void {
trace("done!")
//loadThumbs()
count++;
trace("count " , count)
}

and then I compiled about 8 more times.

 

I think this is either a bug in Flash CC or a problem with your particular install. 

I'm guessing maybe a memory leak in the Flash player that the IDE uses.

 

I highly doubt that it is an error in LoaderMax that we can fix as:

1) there has never been an issue in our code that forces an IDE crash that I can recall

2) this crash can not be replicated in the browser plugins or other players (only happens in CC)

 

Trust me, I did my best to replicate it. 

I am using Flash CC  13.1.0.266 MAC

 

We will certainly keep our ears open and take note if more reports come in.

Link to post
Share on other sites

I think you are right that the problem is with Flash, not LoaderMax.  I just redid the test using the Flash loader and got the exact same results.  My Flash version is 14.0.0.110.  It seems there's no way to change the version of the Flash player that Flash uses which is too bad.  I'd love to test a different player.

 

I've been working exclusively with Flash for 9 years now and this has only happened once before.  I had a single file that I inherited from someone else and it crashed quite often when publishing.  But as soon as I moved on to my next project and a new set of files, the problem went away.

 

Thanks for your information and work.

Link to post
Share on other sites

I just tested this with the Flash Loader class and Flash version 13.1.0.226 and found the same problem.  It crashed after 3 publishes.

  • Like 2
Link to post
Share on other sites

Thanks for the report on your extensive testing. It's helpful to know that the AS3 Loader's also crash and the problem must be starting there (which is why it was happening with LoaderMax).

Link to post
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.

×