Reputation: 51837
I've got a weird issue with the RadioButton(fl.controls) when I add it to the stage.
Here's a quick way to reproduce the issue:
The container width will trace 100 even though the RadioButton instance on stage is less than 100 wide.
If I add the component from code, it works if I invalidate the stage after adding the RadioButton first, then check the container width in a Event.RENDER handler.
Is there any fix for this measurement bug when adding the RadioButton manually in the IDE/Authoring ?
Upvotes: 0
Views: 130
Reputation: 4934
This is because Flash uses a scaling ratio in order to resize objects at runtime, rather than using width and height measures.
So if you load the RadioButton and shrink its size, you are actually scaling by say 0.89 of the original size.
When you run the application, your RadioButton is still 100px wide, but scaled down by a ratio of 0.89 of the original.
If you trace the scaleX
and scaleY
properties of a resized and a non-resized RadioButton, you will see what I mean.
Check out this documentation for more:
Upvotes: 3