Jump to content
Search Community

ContentDisplay.clone()

Doccie test
Moderator Tag

Recommended Posts

Hey,

 

I've noticed the behavior as described in viewtopic.php?p=14724#p14724 and was wondering, what if you'd want to use the same rawContent (mainly for an ImageLoader) in several places...?

Now, my first idea was to write a help class that just duplicates the rawContent, but then you lose the nice cropping functionalities the ContentDisplay offers, so I thought about adding a clone method to the ContentDisplay class, but since the rawContent doesn't necessarily have to be a bitmap (VideoLoader, SWFLoader), that won't work either.

 

So my question; is there a way to add multiple instance of the same ContentDisplay to the stage?

Link to comment
Share on other sites

Not directly, no - you cannot do that with any DisplayObject. However, you could manually duplicate your Bitmap and put it into a ContentDisplay I suppose (set the ContentDisplay's rawContent to that Bitmap). It's not exactly what ContentDisplay was meant to be used for since it's supposed to have a "loader" property that points at a real loader, but who am I to tell you not to use it that way? :)

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