Flex - 데이타타입(DataType)

Programming/Flex 2007.08.10 17:32 Posted by 파란크리스마스

츨처

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001823.html

단순 데이타 타입

int, uint, Number, Boolean, String, void, Null

var value:int = 123; // int.MAX_VALUE = 2,147,483,647 , int.MIN_VALUE  = -2,147,483,648
var value:unit = 4000000;
var value:uint = 0x336699FF;
var value:uint = new uint( 0x336699FF );
var value:Number = 123.45; // MAX_VALUE = 1.79769313486231e+308 , Number.MIN_VALUE = 4.940656458412467e-324
var value:Boolean = true;
var value:String = "Hello World!";

복합 데이타 타입

Arrays

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

 <mx:Script>
  <![CDATA[
   public function test():void
   {
    var value1:String = "a";
    var value2:String = "b";
    var value3:String = "c";

    var values1:Array = new Array( value1, value2, value3);
    var values2:Array = [value1, value2, value3];

    var values3:Array = new Array();
    values3[ 0 ] = value1;
    values3[ 1 ] = value2;
    values3[ 2 ] = value3;

    var values4:Array = new Array();
    values4.push( value1);
    values4.push( value2);
    values4.push( value3);
   
    trace("0 values4.length = " + values4.length);
   
    var value1_1:String = values4.pop();
    var value2_1:String = values4.pop();
    var value3_1:String = values4.pop();
   
    trace("1 values4.length = " + values4.length);
    trace("value3_1 = " + value3_1);
    trace("value2_1 = " + value2_1);
    trace("value3_1 = " + value3_1);
   
   }
   ]]>
  </mx:Script>
 
 <mx:Button x="33" y="172" label="Button" click="test()"/>

</mx:Application>


trace

0 values4.length = 3
1 values4.length = 0
value3_1 = a
value2_1 = b
value3_1 = a
신고


 

티스토리 툴바