Jump to content
Search Community

LoaderMax ImageLoader

scotbord test
Moderator Tag

Recommended Posts

I have another problem with ImageLoader.

 

I want to be able to load images on the background and to add them to DisplayContainer whenever I want. I should be able to add or remove the image from the container even if it's not fully loaded. The class Loader seems to do that very well.

 

For instance I click on a button to display an image that should be loading on the background. The image is not loaded yet, but still added to the container. The user changes his mind, and click on another button, the current image content should be removed from DisplayContainer but keep loading (since it's a Loader), and display the new image (still even if it's not complete). I want to avoid doing multiple request to get image content all the time if a user press buttons many times.

 

My images are on the current domain, i.e. ImageLoader content will return a Bitmap, but I want a Loader even with scriptAccessDenied set to false.

Besides if I try to get content from an image that is not completely loaded it return null.

 

 

Is it possible to add a features to handle the case where I want Loader only, not bitmap.

Thank you

Link to comment
Share on other sites

I just posted an update that I think you'll really like. ImageLoader and SWFLoader now create a Sprite immediately into which the remote content will load. When you get an ImageLoader's or SWFLoader's "content" property, it refers to this Sprite. Again, you can get it immediately. I also added a bunch of other conveniences like being able to center the registration point (centerRegistration:true), various scaleModes for controlling how the image/swf scales to fit into the width/height that you set (if you set them), offsetRegX/offsetRegY, and hAlign/vAlign. See the docs for details.

 

Thanks for the suggestion.

Link to comment
Share on other sites

Sorry, I still have the same error (when I call content property it claims it is null while it should be a Sprite). But when I steped into your code, I could not find where you assign content to be a new Sprite; Is that normal? Sprit is only mentioned in the ASdoc but is not actually in the code.

 

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