Share Posted January 10, 2013 Hello, I'm trying to transform a text input field that should resize the text font size when scaling the transform item, and that should resize itself when the user writes text in it. To resize the text field i set the "autoSize" property to true, and to increase the font size i wrapped the text field with a movieclip and then add that to the TransformManager. Here is my code: //create the font format var font: Font = new FuturaStdBold(); _textFormat = new TextFormat(); _textFormat.size = 18; _textFormat.align = "center"; _textFormat.font = font.fontName; //Create the text field _textField = new TextField(); _textField.width = 200; _textField.height = 40; _textField.x = 100; _textField.y = 100; _textField.type = "input"; _textField.multiline = true; _textField.embedFonts = true; _textField.autoSize = TextFieldAutoSize.CENTER; _textField.defaultTextFormat = _textFormat; _textField.text = "Ingresa tu texto aquí..."; _textField.addEventListener(Event.CHANGE, keyStroked, false, 0, true);[/font] [font=arial, helvetica, sans-serif]//[/font][font=arial, helvetica, sans-serif]_mcConte is the wrapper for the text field[/font] [font=arial, helvetica, sans-serif]_mcConte.addChild(_textField); //add the item to the stage _container.addChild(_mcConte); //add the item to the transformManager _transItem = _transManager.addItem(_mcConte); _transItem.hasSelectableText = true;[/font] The resize of the text field works fine, however the scaling does not. When i try to scale the item and it has some rotation, the text field gets out of the transformManager Box, but if i set "hasSelectableText" to false, then the scaling works but i cant input text. Any help would be greatly appreciated. I attached some screenshots of the problem. Link to comment Share on other sites More sharing options...
Share Posted January 11, 2013 Unfortunately the autoSize functionality is creating conflicts. It's a little bit like trying to grab something and every time you move it, it jumps to a different size/position inside your hand. I don't see a way that TransformManager could support TextFields that are shifting their size/position like that. I wish I had better news for you. Link to comment Share on other sites More sharing options...
Author Share Posted January 11, 2013 I see, but doing some tests, even if i remove the autoSize property, leaving the hasSelectableText to true causes the same problem. Any idea of what may be happening? Link to comment Share on other sites More sharing options...
Author Share Posted January 11, 2013 (edited) In the following link you can find a simple .fla that reproduces the problem. [link removed because it contains TransformManager, a $299 product] Hope it can be of help. Oops, that was stupid lol. here is the .fla without the TransformManager: https://www.dropbox....xtTransform.fla Edited January 12, 2013 by GreenSock Link to comment Share on other sites More sharing options...
Share Posted January 12, 2013 Aha! I see what the problem is and I just uploaded an update to TransformManager that should resolve that issue. It had to do with non-TextFields needing to be unrotated first before applying the width/height values and then rotated back internally. Please log into your GreenSock account and download the latest version. https://www.greensock.com/account/ Sorry about any confusion there, and thank you for putting together a simple example FLA. That was very helpful indeed. Link to comment Share on other sites More sharing options...
Author Share Posted January 17, 2013 Problem solved with the update! Thank you very much Jack. Link to comment Share on other sites More sharing options...
Share Posted February 19, 2013 Do you think you could update AS2 version as well? Link to comment Share on other sites More sharing options...
Share Posted February 20, 2013 Absolutely - the AS2 version has now been updated. Feel free to download it from your GreenSock account at https://www.greensock.com/account/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now