我有一个基本类的皮肤是 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>