Max
Max

Reputation: 325

BorderContainer Skin File is somehow empty

When i generate skin files lets suppose for s:Button, they contain all the design related code such as graphic, label etc, but when i create a skin file of BorderContainer, it gets created without any design code and event the contentGroup part is commented and i dont know how to use it.

Could you please guide me how to custimize its skin file?

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

[HostComponent("spark.components.BorderContainer")]

<!-- states -->
<s:states>
    <s:State name="disabled" />
    <s:State name="normal" />
</s:states>

<!-- SkinParts
name=contentGroup, type=spark.components.Group, required=false
-->

Upvotes: 1

Views: 1124

Answers (2)

Mike
Mike

Reputation: 11

Add the skin elements into the component

then at the bottom add this line:

<s:Group id="contentGroup" left="0" top="0" right="0" bottom="0"/>

this will create a group on top of the skin. After doing this it should act as a traditional border container.

Upvotes: 1

Be Free Studios
Be Free Studios

Reputation: 110

This should explain it better... From Abobe's Docs.... "Note: Because you use CSS styles and class properties to control the appearance of the BorderContainer container, you typically do not create a custom skin for it. If you do create a custom skin, your skin class should apply any styles to control the appearance of the container." http://help.adobe.com/en_US/flex/using/WS03d33b8076db57b9466e6a52123e854e5d5-8000.html

Also...

I've noticed if you are using the wizard under file--> new MXML Skin you will not see the BorderContainerSkin available. What you are doing is actually creating an MXML class that is derived from BorderContainer (a component class, not a skin class), therefor it does not have any of the graphics and drawing methods. It seems as if you are trying to create the wrong type of class.

Unlike most skins in Flex 4, the BorderContainerSkin class is actually an Actionscript class. So.... couple of options...

1) You Can Extend BorderContainerSkin

goto: File-->New-->Actionscript Class--> type BorderContainerSkin in the SuperClass field and select it when it appears, name your new skin class and you should be good to go.

2) Create your own

BorderContainerSkin extends Skin so You can reference the code in BoderContainerSkin and create your own actionscript class that extends Skin with your custom logic.

Hope this help

Upvotes: 1

Related Questions