How to get scaled height and width?

I have s:Groupwith several components of a fixed size, this suggests that 200x300, 300x150etc. Now, if I resize s:Groupusing resizeMode=Scale, (scale down). and try reading the reduced size of these child components, but they still have the same height and width.

How can I get the width and height after scaling the parent group?

thank

+5
source share
2 answers

Hey there:] At first I thought it would be an easy task to get width and height. But when I tried it, none of the explicit width and measuredWidth worked when resizeMode is set to s: Group scale.

So, I found a way, but I'm not sure if this is the best solution:

write this in the script tag:

import mx.core.mx_internal; Use the mx_internal namespace

then if you have

Group id = "group" resizeMode = "scale" and s: button id = "myButton" inside it

to, for example, get the width of myButton, just calculate the group. $ scaleX * myButton.width Hope this works.

all the best, blz

+3
source

myComponent.transform.pixelBounds.width. X. , , X , . .

+4

All Articles