IT기술/Flex

flex 11 NumericStrepper Test

dobbby 2008. 11. 20. 18:55
반응형


NumericStreeperTest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="comp1.*">
 <mx:Panel width="400" height="400" layout="absolute" horizontalCenter="0" verticalCenter="0" title="NumericStepperTest">
  <ns1:MyImage id="img" horizontalCenter="0" verticalCenter="-50" backgroundAlpha="1.0" alpha="1.0">
  </ns1:MyImage>
  
  <mx:Label text="alpha" verticalCenter="90" horizontalCenter="-100"/>
  <mx:NumericStepper horizontalCenter="-50" verticalCenter="90" id="ns1" minimum="0" maximum="1" stepSize="0.05" change="changed()" enabled="true" width="50" value="1"/>
  <mx:Label text="rotation" verticalCenter="90" horizontalCenter="50"/>
  <mx:NumericStepper horizontalCenter="100" verticalCenter="90" id="ns2" minimum="0" maximum="360" stepSize="10" change="changed()" enabled="true" width="50" value="0"/>
  <mx:Label text="xsize" horizontalCenter="-100" verticalCenter="120"/>
  <mx:NumericStepper horizontalCenter="-50" width="50" verticalCenter="120" id="ns3" change="changed()" minimum="0.5" maximum="2" stepSize="0.1" value="1"/>
  <mx:Label text="ysize" horizontalCenter="50" verticalCenter="120"/>
  <mx:NumericStepper horizontalCenter="100" verticalCenter="120" width="50" id="ns4" change="changed()" minimum="0.5" maximum="2" stepSize="0.1" value="1"/>
  <mx:Label text="xysize" horizontalCenter="-100" verticalCenter="150"/>
  <mx:NumericStepper horizontalCenter="-50" verticalCenter="150" width="50" id="ns5" minimum="0.5" maximum="2" stepSize="0.1" value="1" change="scale()"/>
  
 </mx:Panel>
 <mx:Script>
  <![CDATA[
   function changed():void{
    img.alpha = ns1.value;
    img.rotation = ns2.value;
    img.scaleX = ns3.value;
    img.scaleY = ns4.value;
   }
   function scale():void{
    img.scaleX = ns5.value;
    img.scaleY = ns5.value;
   }
  ]]>
 </mx:Script>
</mx:Application>
반응형