我无法让我的TextArea获取我在下面的mxml皮肤文件中所做的焦点皮肤。谁能帮我这个。请注意,在我的应用程序css文件中,我已经指定了焦点皮肤:focus-skin:ClassReference(“skins.focusSkin”);
皮肤文件代码:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import spark.components.supportClasses.SkinnableComponent;
private var _target:SkinnableComponent;
public function get target():SkinnableComponent
{
return _target;
}
public function set target(value:SkinnableComponent):void
{
_target = value;
if (_target.skin)
_target.skin.addEventListener(FlexEvent.UPDATE_COMPLETE,
skin_updateCompleteHandler, false, 0, true);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
this.setActualSize(target.width, target.height);
super.updateDisplayList(target.width, target.height);
}
private function skin_updateCompleteHandler(event:Event):void
{
invalidateDisplayList();
}
]]>
</fx:Script>
<s:BitmapImage id="focusGroup" source="@Embed(source='mySkinFile.swf', symbol='mySymbol')" />
</s:Group>
答案 0 :(得分:0)
看一下这篇博客文章中的示例,演示如何在spark中创建自定义焦点外观: http://flexponential.com/2010/01/24/custom-focusskin-for-spark-components-in-flex-4/