`
hanyiduo
  • 浏览: 77170 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

高亮显示焦点随在的栏目

    博客分类:
  • Flex
XML 
阅读更多
<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
        layout="vertical" 
        verticalAlign="middle" 
        backgroundColor="white"> 
  
    <mx:Style> 
        FormItem { 
            paddingLeft: 4; 
            paddingRight: 4; 
            paddingTop: 4; 
            paddingBottom: 4; 
        } 
    </mx:Style> 
  
    <mx:Script> 
        <![CDATA[ 
            private const BACKGROUND_COLOR:Object = "haloBlue"; 
  
            private function formItem_focusIn(evt:FocusEvent):void { 
                var item:FormItem = FormItem(evt.currentTarget.parent); 
                item.setStyle("backgroundAlpha", 0.2); 
                item.setStyle("backgroundColor", BACKGROUND_COLOR); 
            } 
  
            private function formItem_focusOut(evt:FocusEvent):void { 
                var item:FormItem = FormItem(evt.currentTarget.parent); 
                item.setStyle("backgroundColor", null); 
            } 
        ]]> 
    </mx:Script> 
  
    <mx:Form> 
        <mx:FormItem label="First name:"> 
            <mx:TextInput id="firstName" 
                    focusIn="formItem_focusIn(event);" 
                    focusOut="formItem_focusOut(event);" /> 
        </mx:FormItem> 
        <mx:FormItem label="Last name:"> 
            <mx:TextInput id="lastName" 
                    focusIn="formItem_focusIn(event);" 
                    focusOut="formItem_focusOut(event);" /> 
        </mx:FormItem> 
    </mx:Form> 
  
</mx:Application>


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics