FB4 TextArea 焦点皮肤
我无法让我的 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>
I can't get my TextArea to take the focus skin which I did in the mxml skin file below. Can anyone help me with this. Note that in my application css file I have specified the focus skin as such : focus-skin: ClassReference("skins.focusSkin");
Skin File Code:
<?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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下这篇博文中的示例,演示如何在 Spark 中创建自定义焦点皮肤:
http://flexponential.com/ 2010/01/24/custom-focusskin-for-spark-components-in-flex-4/
Take a look at the examples in this blog post that demonstrates how to create custom focus skins in spark:
http://flexponential.com/2010/01/24/custom-focusskin-for-spark-components-in-flex-4/