Jump to content
Search Community

adding child to ImageLoader / VideoLoader

failure13 test
Moderator Tag

Recommended Posts

Hi!

For example i got VideoLoader, named video, and i add child inside it, this way:

video.content.addChild(vFrame);

 

I wanted to ask:

1. Is this normal practice, won't such thing prevent normal work of loader and it's properties and goodness of .content / .rawContent or something else?

2. If it is normal, than i can tehnically add any number of children this way?

3. After calling video.dispose(true); will such children be removed from stage, and unloaded from RAM?

Link to comment
Share on other sites

  1. No, that is not a normal practice and I would discourage it. A ContentDisplay object is a wrapper for the content of the loader, not for other stuff you want to put in there too. Doing so could prevent the autosizing features from working as intended.
  2. Technically yes, you could, but I wouldn't really recommend it.
  3. The ContentDisplay would be removed from the display list, yes, thus its children would too, but as far as being unloaded from memory, my answer would be: "probably" - it depends on if you created any references to that content in your code, like event listeners, NetStreams, etc. If so, you'd need to clean up after yourself first before the memory could be reclaimed (just like anything in ActionScript).

Does that help?

Link to comment
Share on other sites

Yeah, thank you for the answer!

I have tested it out with 1 child, it works, even unloading it from the memory...

 

Have inserted a frame around the VideoLoader, which center set to loader's center, and this seem to hep a lot, because resize functions works a bit faster than, when you have to caluclate also x/y value for the frame...

And when i call dispose, it's get unloaded fully from memory, and of course from display list!

 

The benifit of such aproach is basicly making resize a bit faster...And seem that autosizing works well!

Probably will stick with this for a while and test it more!

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