package com.components
{
import mx.controls.Label;
[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
public class ColorLabel extends Label
{
public function ColorLabel()
{
super();
}
override public function styleChanged(styleProp:String):void
{
super.styleChanged(styleProp);
if("backgroundColor" == styleProp)
{
invalidateDisplayList();
}
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
with(graphics)
{
clear();
beginFill(getStyle("backgroundColor"));
drawRect(0, 0, this.width, this.height);
endFill();
}
}
}
}
ColorLabel
最新推荐文章于 2023-11-29 23:25:52 发布