Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Apache Flex 4.14.0
-
None
-
None
Description
Changing the buttons 'fonSize' style at runtime by e.g. using a slider has no effect:
<s:HSlider id="sdFontSize" minimum="10" maximum="500" /> <s:Button id="btn" label="test" fontSize="{sdFontSize.value}" />
I've tried to fix this and found that moving the 'fontSize' population from 'initializationComplete()' to 'updateDisplayList()' works like a charme:
override protected function initializationComplete():void { ... // Set 'fontSize' here cause doing this inside the 'labelDisplay' results in an error // labelDisplay as Label).setStyle("fontSize", fontSize); ... } override protected function updateDisplayList(...) : void { ... super.updateDisplayList(unscaledWidth, unscaledHeight); // Set 'fontSize' here cause doing this inside the 'labelDisplay' results in an error labelDisplay as Label).setStyle("fontSize", fontSize); }
Cause I'm not a 'high level' Flex programmer I don't know if doing this results in other bugs.