Sign in to follow this  
vincent

Flex 4.5 and transforming textarea

Recommended Posts

Hi all,

 

I have a little problem with Flex 4.5 (4.5.0.19786) and the spark.components.TextArea.

 

Here is the simple code :

 




 

And the result output :

post-1919-133152002212_thumb.jpg

 

Do you have an idea ?

 

Thanks

Share this post


Link to post
Share on other sites

I'm a little confused - according to Adobe, Flash Builder 4.5 isn't out yet. Maybe they've still got some bugs in the beta you're using?

 

I just tried this in Flash Builder 4 and it worked fine:

			   xmlns:s="library://ns.adobe.com/flex/spark" 
		   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()">
<br>		import com.greensock.transform.*;<br><br>		private function init(event:Event=null):void {<br>			var tm:TransformManager = new TransformManager();<br>			tm.addItem(test2, TransformManager.SCALE_WIDTH_AND_HEIGHT);<br>		}<br>




 

Also keep in mind that Adobe has had bugs in their Flex framework that caused getBounds() problems if your container had a border on it (the thicker the border, the further off the getBounds() results were). Maybe you've got a thick border on your container?

Share this post


Link to post
Share on other sites

Yep, that's yet another bug/inconsistency in the Flex framework. Unbelievable. Here's how you can verify it:

 

			   xmlns:s="library://ns.adobe.com/flex/spark"
		   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()">
<br>		private function init(event:Event=null):void {<br>			var bounds:Rectangle = test2.getBounds(test2);<br>			trace(bounds); //reports (x=-18, y=-18, w=206, h=169)<br>		}<br>




 

The TextArea's bounds are reported as starting at local coordinates of -18,-18 instead of 0,0! I'll try to get in contact with Adobe to report this and I'd encourage you to do the same. Again, this isn't a problem with TransformManager - it's a Flex framework problem.

Share this post


Link to post
Share on other sites

Hello is there a recommended workaround for this? I'm using Flex 4.6 and getting the same problem.

 

According to Adobe: "Use of the low-level getBounds is not recommended in UIComponents. It will factor in hidden display objects."

http://forums.adobe.com/message/4146856

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.