FB4 TextArea 焦点皮肤

发布于 2024-11-06 06:17:57 字数 1572 浏览 2 评论 0原文

我无法让我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上芳菲 2024-11-13 06:17:57

看一下这篇博文中的示例,演示如何在 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文