Jump to content
Search Community

Setting width and height on a TransformItemTF [SOLVED]

eric404 test
Moderator Tag

Recommended Posts



I'm developping an authoring tool allowing users to layout images and texts and have a function which set the width or height of all selected items to the value of the first item in the selection list. It works well on images, however, there is a problem when it's applied to TextField:

The width, for example, is set correctly but if I select one of the TextField which has its width changed and try to scale it by manually resizing the selection box around it, it reverts to its old width value and remains locked untill the selection box is resized to fit the TextField dimensions.

To prevent this problem, the solution I found is to remove the selected items from the Transformanager instance so they aren't transformable anymore, set their width or height and add them back in the list of transformable items.

I don't like it much as it's a bit ugly, is this a known problem and is there a more elegant solution ?





Link to comment
Share on other sites

You're using the AS3 version, right?


If you're setting it directly (and circumventing the TransformItem), there's no way for the TransformItem or TransformManager to know that the change occurred. That's why there's an update() method in TransfromItem - try calling that after you make your edit, or better yet, just change the width/height via the TransformItem instance.


I was able to set the width/height of a TextField's TransformItem instance without a problem and it behaved as expected, but if you're running into trouble, please send me your code (via Private Message) and I'll look into it.

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