Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
offshoresolutions

Display Object's width and height not updating

Recommended Posts

Hi,

 

I have an image control inside a transformmanager. whenever I scale the image, only the $width and $height are updated and not the width and height. Has anyone encouter something like this?

 

thanks!

Link to comment
Share on other sites

Could you explain further? I don't understand your question. What's $width and $height?

Link to comment
Share on other sites

Hi,

 

i'm using flex 3. the $width and $height are the internal properties of mx.core.UIComponent. the public propeties width and height dont change even if i resize the image

 

thanks!

Link to comment
Share on other sites

Hi,

 

what would be the proper way to get a display object's dimensions after scaling?

 

thanks

Link to comment
Share on other sites

Ah, as you can tell I'm not much of a Flex guy :)

 

There are numerous bugs in the Flex framework. I have spoken directly to Adobe about this and they have confirmed it. When transform.matrix values are updated (which TransformManager does), the width, height, scaleX, and scaleY properties are NOT updated properly! VERY frustrating. I made not of that on the TransformManager blog page. Anyway, if you need to find out the accurate values, you should be able to use the gs.transform.utils.MatrixTools class that came with TransformManager in conjunction with getBounds() to figure it out, like this:

 

var bounds:Rectangle = my_mc.getBounds(my_mc); //gets the unscaled dimensions of my_mc

var trueWidth:Number = bounds.width * MatrixTools.getScaleX(my_mc.transform.matrix);
var trueHeight:Number = bounds.height * MatrixTools.getScaleY(my_mc.transform.matrix);

 

Does that work okay for you?

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