Jump to content
Search Community

autoDispose Problem

mjperry51 test
Moderator Tag

Recommended Posts

This is my XMLLoader declaration:

var loader:XMLLoader = new XMLLoader("preloader.xml", {name:"preloader", onProgress:progressHandler, onComplete:_queueCompleteHandler, autoDispose:true});

 

This is my XML file:

 

<?xml version="1.0" encoding="iso-8859-1"?> 
























 

Debugging the file gives the following results:

 

Attempting to launch and connect to Player using URL D:\Incite\Incite Flash Site 2011\Site\main.swf

[sWF] D:\Incite\Incite Flash Site 2011\Site\main.swf - 203663 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\stillCloud.swf - 21737 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\homeContent.swf - 26690 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\galleryContent.swf - 125569 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\brandRight.swf - 304625 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\packageRight.swf - 334058 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralRight.swf - 103366 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\internetRight.swf - 43518 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalRight.swf - 54626 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\newsRight.swf - 27859 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationsContent.swf - 16634 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\contactContent.swf - 32368 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationRight.swf - 95997 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\contactRight.swf - 94432 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\brandGallery.swf - 517128 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\packageGallery.swf - 1277178 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralGallery.swf - 1274652 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\webGallery.swf - 426004 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalGallery.swf - 558177 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\brandRight.swf - 304625 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralRight.swf - 103366 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\contactRight.swf - 94432 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\CSS_featured_gallery.swf - 972774 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalRight.swf - 54626 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\fischers_recent_gallery.swf - 690577 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\internetRight.swf - 43518 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\ltd_recent_gallery.swf - 447869 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\ltdNews.swf - 229701 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\newsRight.swf - 27859 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\packageRight.swf - 334058 bytes after decompression

[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationRight.swf - 95997 bytes after decompression

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\digitalRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\brandRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\collateralRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\contactRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\internetRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\newsRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\packageRight.swf

[unloadSWF] D:\Incite\Incite Flash Site 2011\Site\presentationRight.swf

 

Unloading the files stops my SWF cold.

 

If I remove the autoDispose var the redundant files are not removed and the SWF runs normally, although sluggishly.

 

There is no other LoaderMax code in any other class. And other than the homeRight.swf (which is being used for a placeholder) how can I stop the multiple loads of some of the swfs?? Can I limit the files being loaded to those listed in the XML file, or does LoaderMax by default load ALL swfs found in the classes?

 

Thanks,

 

Mike

Link to comment
Share on other sites

What are you expecting autoDispose to do? I wonder if you might be misunderstanding its purpose. If autoDispose is true, that simply means that as soon as the loader completes it IMMEDIATELY disposes itself, like calling dispose(false). So after that point, you will not be able to find the loader (it was disposed) using LoaderMax.getLoader() or LoaderMax.getContent(). Notice that it does NOT unload the actual content. It only disposes the actual loader instance. For example, if you dispose(false) an ImageLoader, its image will remain untouched, but the ImageLoader instance will get disposed and made eligible for garbage collection. Did you think the content would be unloaded too?

 

You asked "LoaderMax by default load ALL swfs found in the classes?" - no, it only loads the ones that have load="true" in the XML. Since you nested all of your loaders into a instance and set load="true" on that LoaderMax, it of course loads all of its children too. If you only want to load a subset of the children, don't set load="true" on the node and instead, put it on whichever children you want loaded. Or use two separate nodes - one for the stuff you want loaded and the other for the ones you don't. Put load="true" on the one you want loaded but not on the other one.

 

Make sense?

 

If you're still having trouble, please post a simple FLA (and support files) that clearly demonstrates the issue so that we can publish it and see for ourselves what's going on.

Link to comment
Share on other sites

What are you expecting autoDispose to do? I wonder if you might be misunderstanding its purpose. If autoDispose is true, that simply means that as soon as the loader completes it IMMEDIATELY disposes itself, like calling dispose(false). So after that point, you will not be able to find the loader (it was disposed) using LoaderMax.getLoader() or LoaderMax.getContent(). Notice that it does NOT unload the actual content. It only disposes the actual loader instance. For example, if you dispose(false) an ImageLoader, its image will remain untouched, but the ImageLoader instance will get disposed and made eligible for garbage collection. Did you think the content would be unloaded too?

That's what I expected -- I was curious as to why when it was unloading the selected swfs. If I removed the autoDispose statement the [unloadSWF] didn't happen.

 

You asked "LoaderMax by default load ALL swfs found in the classes?" - no, it only loads the ones that have load="true" in the XML. Since you nested all of your loaders into a instance and set load="true" on that LoaderMax, it of course loads all of its children too. If you only want to load a subset of the children, don't set load="true" on the node and instead, put it on whichever children you want loaded. Or use two separate nodes - one for the stuff you want loaded and the other for the ones you don't. Put load="true" on the one you want loaded but not on the other one.

 

Make sense?

 

Yes -- Kind of. Are you saying to create two LoaderMax instances in the XML file -- one listing the files I want loaded with load set to true, and another listing all the children I I don't want loaded with load unset, or set to false? I'm still learning AS in general; sometimes I don't get a good handle on exactly what the documentation is saying. It probably makes perfect sense to an experienced coder -- that's not me yet, but I'm learning ;)

 

If you're still having trouble, please post a simple FLA (and support files) that clearly demonstrates the issue so that we can publish it and see for ourselves what's going on.

 

Will do -- thanks for the explanation. . .

 

Mike

 

ETA: If autoDispose destroys the loaders, how can I be sure I have all the loader contents assigned to MovieClips before the loader instance is gone?

Link to comment
Share on other sites

Yes -- Kind of. Are you saying to create two LoaderMax instances in the XML file -- one listing the files I want loaded with load set to true, and another listing all the children I I don't want loaded with load unset, or set to false? I'm still learning AS in general; sometimes I don't get a good handle on exactly what the documentation is saying. It probably makes perfect sense to an experienced coder -- that's not me yet, but I'm learning ;)

Yep. Like:



       ...



       ...

 

Or put load="true" on each individual loader instead. Either way is fine.

 

ETA: If autoDispose destroys the loaders, how can I be sure I have all the loader contents assigned to MovieClips before the loader instance is gone?

It won't autoDispose until right AFTER its COMPLETE event is dispatched. So if you add an onComplete handler, your code in there will run first. You can assign all your values, etc. in there.

 

Cool?

Link to comment
Share on other sites

Yep. Like:



       ...



       ...

 

Or put load="true" on each individual loader instead. Either way is fine.

 

I must be missing something -- please bear with me.

 

One XMLLoader file follows:

 

<?xml version="1.0" encoding="iso-8859-1"?> 




























 

The Debug output using this file follows:

 

Attempting to launch and connect to Player using URL D:\Incite\Incite Flash Site 2011\Site\main.swf
[sWF] D:\Incite\Incite Flash Site 2011\Site\main.swf - 203674 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\stillCloud.swf - 21737 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeContent.swf - 26690 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\galleryContent.swf - 125569 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\brandRight.swf - 304625 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\packageRight.swf - 334058 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralRight.swf - 103366 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\internetRight.swf - 43518 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalRight.swf - 54626 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\newsRight.swf - 27859 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationsContent.swf - 16634 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\contactContent.swf - 32368 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationRight.swf - 95997 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\contactRight.swf - 94432 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\brandGallery.swf - 517128 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\packageGallery.swf - 1277178 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralGallery.swf - 1274652 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\webGallery.swf - 426004 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalGallery.swf - 558177 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\CSS_featured_gallery.swf - 972774 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\fischers_recent_gallery.swf - 690577 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\ltd_recent_gallery.swf - 447869 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\ltdNews.swf - 229701 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeContentUpperLeft.swf - 144817 bytes after decompression

 

Notice the five files that load after galleryContent.swf. They are all listed in the second LoaderMax instance in the XML file -- if i understood correctly the second instance should have prevented them from loading. These five files are loaded in the galleryContent class.

 

If I remove galleryContent,swf from the first LoaderMax instance in the XML file I get the following Debug output:

 

Attempting to launch and connect to Player using URL D:\Incite\Incite Flash Site 2011\Site\main.swf
[sWF] D:\Incite\Incite Flash Site 2011\Site\main.swf - 203675 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\stillCloud.swf - 21737 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeContent.swf - 26690 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationsContent.swf - 16634 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\presentationRight.swf - 95997 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\newsRight.swf - 27859 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\homeRight.swf - 120194 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\contactContent.swf - 32368 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\brandGallery.swf - 517128 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\contactRight.swf - 94432 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\packageGallery.swf - 1277178 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\collateralGallery.swf - 1274652 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\webGallery.swf - 426004 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\digitalGallery.swf - 558177 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\CSS_featured_gallery.swf - 972774 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\fischers_recent_gallery.swf - 690577 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\ltd_recent_gallery.swf - 447869 bytes after decompression
[sWF] D:\Incite\Incite Flash Site 2011\Site\ltdNews.swf - 229701 bytes after decompression

 

The five files don't load.

 

Be gentle -- what am I missing?? Is the Flash compiler (not LoaderMax) doing the loading of those files because they are in the galleryContent class?

 

Thanks,

 

Mike

Link to comment
Share on other sites

The loaders that you have in your xml have no control over or relation to loaders declared in other swfs.

If GalleryContent is trying to load 5 swfs, those swfs are going to load regardless of what is in your xml.

I understand.

 

Still learning how Flash does what it does -- so when galleryContent loads (called by LoaderMax) it also loads it's own children swfs.

 

Thanks, Carl.

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...