Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34702

Flatspark Button: Changing fontSize at runtime has no effect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Apache Flex 4.14.0
    • None
    • FlatSpark
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            okrueger@edscha.com Olaf Krüger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: