Jump to content
Search Community

Transform Manager bounds incorrect

johncblandii test
Moderator Tag

Recommended Posts

You can see the picture (attached) to see the problem.


Basically, user drags a photo down, the item is added to a FlexTransformManager and I call: FlexTransformManager(parent).selectItem(this, false);.


The bounds are corrected when you deselect the item then reselect it but the initial does not select it properly. Ideas?

Link to comment
Share on other sites

Could you send me a sample Flex project (or FLA) that demonstrates the issue? Are you using the latest version? Keep in mind that if you edit the contents/scale/rotation of the object without going through TransformManager, you need to make sure you call update() on the associated TransformItem so that it refreshes.

Link to comment
Share on other sites

Unfortunately I can't. The thing is wrapped into a lot of other functionality.


Is there a way to get to the transform item from within the added child? Meaning, I'm adding a custom class which loads an image file. From the custom class the parent is the manager not the item, which is fine.


For now, just to test update(), I'm going to add the transform item to the image class as a property for now. Let me know if there is a better way of accessing it.

Link to comment
Share on other sites

Just keep in mind the following:


1) All items that a TransformManager manages must share the same parent (as indicated in all the documentation and on the blog)


2) You can get the TransformItem associated with any DisplayObject like


var item:TransformItem = myManager.getItem(myObject);


3) When dynamically loading content, make sure that you either wait until it has fully loaded and instantiated BEFORE adding it to the TransformManager or just call update() on the TransformItem after it has loaded and instantiated.


Does that help? (not sure I understood your question)

Link to comment
Share on other sites

1) Yep. That's understood.

2) Sweet. Missed getItem.

3) Unfortunately the class is built around the component architecture (updateDisplayList, etc) so I need to add it first. I added the following in my updateDisplayList and it worked. I'll optimize it later now that I see what's up.




Thanks man!

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