Skip navigation
Currently Being Moderated

SOLVED: Composite skinning

Aug 18, 2012 4:40 AM

As far as I know there are two ways to skin Custom components:

 

1) Copy and paste the base skin (spark.skins.spark.TitleWindow etc.) and modify it;

2) Create a composite skin.

 

I have 1) working but it is a little large and I was looking to cut down on the size of the skin. I read a post on extending skins that suggested that this is possible:

 

-- START: DialogNoteSkin.mxml --

 

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

<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"

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

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

        xmlns:skins="spark.skins.spark.*">

 

    <fx:Metadata>[HostComponent("view.DialogNote")]</fx:Metadata>

 

    <fx:Script>

        <![CDATA[

            import spark.components.Group;

            import spark.skins.spark.TitleWindowSkin;

 

            public function get contentGroup():Group {

                return titleWindowSkin.contentGroup;

            }

 

        ]]>

    </fx:Script>

 

    <s:states>

        <s:State name="normal" />

        <s:State name="inactive" />

        <s:State name="disabled" />

        <s:State name="normalWithControlBar" />

        <s:State name="inactiveWithControlBar" />

        <s:State name="disabledWithControlBar" />

        <s:State name="closed" />

    </s:states>

 

    <skins:TitleWindowSkin id="titleWindowSkin" left="0" right="0" top="0" bottom="0" />

 

</s:Skin>

 

-- END: DialogNoteSkin.mxml --

 

Where a skins:TitleWindowSkin is included in the DialogNoteSkin.mxml. However I end up with a title window that has a black content area, and it is not draggable either:

 

dialog-note-skin.gif

 

Does anyone know why this doesn't work?

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points