In 4.1 I accessed the textDisplay object directly.

 

But In 4.6 this changed to an interface.

So I decided to dabble with skins

 

      public class TitleStylePanel extends Panel

      {

            [Bindable]

            public var titleStyle:Object = null;

 

            public function TitleStylePanel()

            {

                  super();

            }

      }

 

I generated the skin based on SparkPanelSkin

 

Then changed the following

...               

                <!-- layer 3: text -->

                <!--- @copy spark.components.Panel#titleDisplay -->

                <s:Label id="titleDisplay" maxDisplayedLines="1"

                         left="9" right="3" top="1" bottom="0"
minHeight="30"

 
styleName="{hostComponent.titleStyle}"

                         verticalAlign="middle" fontWeight="bold">

                </s:Label>

...

 

<?xml version="1.0" encoding="utf-8"?>

<sparkcontainers:TitleStylePanel
xmlns:fx="http://ns.adobe.com/mxml/2009"; 

 
xmlns:s="library://ns.adobe.com/flex/spark" 

                              xmlns:mx="library://ns.adobe.com/flex/mx" 

 
xmlns:sparkcontainers="com.cimtek.maglite.views.controls.containers.*" 

                              titleStyle="loginTitle"

 
creationComplete="panel1_creationCompleteHandler(event)" 

                              defaultButton="{loginButton}">

...

 

 

When I run it the titleDisplay.styleName doesn't get updated

 

What am I doing wrong ?

Is there an easier way to change the style of the title without having
to have a skin for each instance

 

Andy

Reply via email to