[
https://issues.apache.org/jira/browse/FLEX-34702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olaf Krüger updated FLEX-34702:
-------------------------------
Component/s: FlatSpark
> Flatspark Button: Changing fontSize at runtime has no effect
> ------------------------------------------------------------
>
> Key: FLEX-34702
> URL: https://issues.apache.org/jira/browse/FLEX-34702
> Project: Apache Flex
> Issue Type: Bug
> Components: FlatSpark
> Affects Versions: Apache Flex 4.14.0
> Reporter: Olaf Krüger
>
> Changing the buttons 'fonSize' style at runtime by e.g. using a slider has no
> effect:
> {Code}
> <s:HSlider id="sdFontSize" minimum="10" maximum="500" />
> <s:Button id="btn" label="test" fontSize="{sdFontSize.value}" />
> {Code}
> I've tried to fix this and found that moving the 'fontSize' population from
> 'initializationComplete()' to 'updateDisplayList()' works like a charme:
> {code}
> 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);
> }
> {code}
> Cause I'm not a 'high level' Flex programmer I don't know if doing this
> results in other bugs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)