我的皮肤是基础clas是GraphicRectangularBorderSkin(来自degrafa)。我用它作为面板皮肤。我正在使用Degrafa 3.2,Flex 3.2。它每次抛出#1502错误(当脚本运行太长时抛出)。如果我删除更改em变量的行,则错误消失。
这堂课基本上是(虽然我为了清楚起见而转述):
<GraphicRectangularBorderSkin xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="http://www.degrafa.com/2007>
<geometry>
<GeometryComposition>
<RegularRectangle width="{skinWidth}" height="{skinHeight}">
<fill>
<SolidFill color="#00ff00" />
</fill>
</RegularRectangle>
</geometry>
<mx:Script>
<![CDATA[
import mx.core.EdgeMetrics;
private var em:EdgeMetrics = new EdgeMetrics(0, 0, 0, 1);
private var headerHeight:Number = 0;
public override function styleChanged(styleProp:String):void{
headerHeight = getStyle("headerHeight");
em = new EdgeMetrics(0, headerHeight, 0, 1);// if i remove this line, the error goes away
}
public override function get borderMetrics():EdgeMetrics{
return em;
}
]]>
</mx:Script>
</GraphicRectangularBorderSkin>
答案 0 :(得分:0)
所以显然你需要使用GraphicPanelSkin作为基类,它会为你处理borderMetrics。
此处的文档:http://www.degrafa.org/docs/com/degrafa/skins/GraphicPanelSkin.html