I copy and paste the spark.skins.spark.PanelSkin to create a custom Panel with 
a close button.There are two problem. I defined some style in the CusPanel.mxml 
which inherit the Panel. How can let the button in the skin class access these 
properties? The second problem is when I clicked the button cause a error 
alert. Is there any new component in Flex4 like TitleWindow in flex3 ?
CusPanel.mxml 
<s:Panel ...>
<fx:Metadata>
[Style(name="gridentColor",type="Array",inherit="yes",arrayType="int")]
[Style(name="close-button-over-background-color", type="uint", inherit="yes", 
format="Color")]
[Style(name="close-button-down-background-color", type="uint", inherit="yes", 
format="Color")]
[Style(name="close-button-down-background-solid-color", type="uint", 
inherit="yes", format="Color")]
</fx:Metadata>
</s:Panel>

CusPanel.mxml 
<!-- copy from the PanelSkin.mxml -->
<s:Group id="topGroup" mask="{topGroupMask}">
...
...   
<s:Button skinClass="CloseButtonSkin" right="3" verticalCenter="0" width="15" 
height="15"/>
</s:Group>
 
ReferenceError: Error #1069: Property null not found on spark.primitives.Rect 
and there is no default value.
 at 
mx.states::AddItems/addItemsToArray()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\states\AddItems.as:697]
 at 
mx.states::AddItems/apply()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\states\AddItems.as:535]
 at 
mx.core::UIComponent/applyState()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:9558]
 at 
mx.core::UIComponent/commitCurrentState()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:9327]
 at 
mx.core::UIComponent/setCurrentState()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:9220]
 at mx.core::UIComponent/set 
currentState()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:5740]
 at 
spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:374]
 at 
spark.components.supportClasses::ButtonBase/commitProperties()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\ButtonBase.as:685]
 at 
mx.core::UIComponent/validateProperties()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:7387]
 at 
mx.managers::LayoutManager/validateProperties()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:572]
 at 
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:730]
 at 
mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1069]

Reply via email to