小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

使NumericStepper组件调节的值可以/不可以手动输入.

editable 属性学习.
示例:

代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/05/17/creating-a-non-editable-numericstepper-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white" viewSourceURL="srcview/index.html">

    
<mx:Script>
        
<![CDATA[
            private function checkBox_change(evt:Event):void {
                var value:Boolean = checkBox.selected;
                numericStepper.mx_internal::inputField.editable = value;
            }
        
]]>
    
</mx:Script>

    
<mx:ApplicationControlBar dock="true">
        
<mx:Form styleName="plain">
            
<mx:FormItem label="editable:">
                
<mx:CheckBox id="checkBox"
                        selected
="true"
                        change
="checkBox_change(event);" />
            
</mx:FormItem>
        
</mx:Form>
    
</mx:ApplicationControlBar>

    
<mx:NumericStepper id="numericStepper"
            width
="100" />

</mx:Application>

posted on 2008-05-18 16:40  『小小菜鸟』  阅读(496)  评论(0编辑  收藏  举报