Olaf Krüger created FLEX-34703:
----------------------------------
Summary: Flatspark ButtonIcon: Changing fontSize/iconFontSize at
runtime has no effect
Key: FLEX-34703
URL: https://issues.apache.org/jira/browse/FLEX-34703
Project: Apache Flex
Issue Type: Bug
Affects Versions: Apache Flex 4.14.0
Reporter: Olaf Krüger
Same behaviour as descibed in Flex-34702:
Changing the buttons 'fonSize' and 'iconFontSize' style at runtime by e.g.
using a slider has no effect:
{Code}
<s:HSlider id="sdFontSize" minimum="10" maximum="500" />
<s:HSlider id="sdIconFontSize" minimum="10" maximum="500" />
<s:Button id="btn" label="test" fontSize="{sdFontSize.value}"
iconFontSize={sdIconFontSize.value} />
{Code}
I've tried to fix this and found that moving the 'fontSize/iconFontSize'
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);
//(iconFont as Label).setStyle("fontSize", iconSize);
...
}
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);
(iconFont as Label).setStyle("fontSize", iconSize);
}
{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)