ActionScript-3 – How to get the height and width of the zoom?

I have an s: there are few fixed-size components in the group, these are assumed to be 200×300, 300×150, etc.
Now, if I adjust s: group with resizeMode = Scale ,(Shrink). And try to read the reduced size of these child components, but they still have the same old height and width.

How to get the width and height after shrinking the parent group?

Thank you

Hey:]
At first I thought I got the width and Height is an easy task. But when I tried it, when the resizeMode was set to s: Group’s “scale”, neither explicitWidth nor measuredWidth worked.

So I found a There are methods, but I’m not sure if it’s the best solution:

Write in the script tag:

import mx.core.mx_internal;
Use the namespace mx_internal ;

If you have one

Group id=”group” resizeMode=”scale”
and a s:Button id=”myButton” inside it

For example, in order to get the width of myButton, just calculate the group.$scaleX * myButton.width< br>I hope this will work.

I wish everything goes well, BLZ

I have an s: there are few fixed-size components in the group, these Is assuming 200×300, 300×150, etc.
Now, if I adjust s: group with resizeMode = Scale, (shrink). And try to read the reduced size of these sub-components, but they still have the same old height and width. < p>

How to get the width and height after shrinking the parent group?

Thank you

Hey:]
At first I thought it was easy to get the width and height. But when I tried When it does, when resizeMode is set to “scale” of s:Group, neither explicitWidth nor measuredWidth work.

So I found a way, but I’m not sure if it is the best Solution:

Write in the script tag:

import mx.core.mx_internal;
Use the namespace mx_internal;

If you have Words

Group id=”group” resizeMode=”scale”
and a s:Button id=” myButton” inside it

For example, in order to get the width of myButton, just calculate the group. $scaleX * myButton.width
I hope this will work.

< p>I wish all the best, BLZ

Leave a Comment

Your email address will not be published.