Follow me Stepbystep Flex tutorial

Source: Internet
Author: User

This demo mainly explains the data type of AS3, first look at the running effect of the demo page, very simple:

The main code is as follows:

<mx:Script>
  <![CDATA [
      public function parseInteger(str:String):int {
       var num:Number = parseInt(str);

        if (!isNaN(num) && num <= int.MAX_VALUE && num >= int.MIN_VALUE) {
        return int(num);
        }

       return 0;
      }

   internal function AbAdd():void {
    var iAnum:int = parseInteger(ATxt.text);
    var iBnum:int = parseInteger(BTxt.text);

    AddTxt.text = String(iAnum + iBnum);
   }

   internal function UnStr():void {
    ShowTxt.text = undefined;
   }

    internal function StrUndef():void {
       ShowTxt.text = String(undefined); 
   }
  ]]>
  </mx:Script>

The emphasis is on the type of int and string for the data type.

for int, the reader must note that int is an object, that is, int is a class that represents a 32-bit signed integer data type, and others see demo examples.

For String,demo, the undefined is null in AS3, not undefined, and if you want to display undefined, you need to use the string () function.

For other data types, the authors recommend a Web site that not only learns about other types of data, but also has basic syntax, which is very good:

ActionScript3.0 Language and component references (oh in Chinese)

http://help.adobe.com/zh_CN/AS3LCR/Flash_10.0/

Oh, demo simple, so everyone is easy to understand:

This stage of the demo is mainly to explain AS3 's grammar and its own characteristics. After the basics of this phase, access to the database, Java Communications, Web development based on flex and so on will be slowly spread out.

Article Source: http://wangyisong.javaeye.com/blog/372543

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.