Actionscript2.0 and Adobe Flash CS3 study Note 2

Source: Internet
Author: User

The Regexp class includes the following methods:Test ()AndExec (), Regexp classTest ()The method only checks whether the provided string contains the Matching content of the regular expression. The Exec () method checks whether the provided string matches the Regular Expression and returns an array with the following content:

  • Matched substring
  • A substring that matches any bracket group in the regular expression.
    There are rich learning resources for actionscript2.0 regular expressions. in the previous article, I just started to learn about and learn more about regular expressions. For more information, see online materials. Here we recommend two links: workshop? Context?livedocs_parts&file=00000111.html. I started learning from here. Now, let's continue with the previous article to summarize some methods and instances for data interaction and communication between AS and ASP. NET.

     4. Communication between AS and ASP. NET
    (1) loadvars Transmission Parameters and background webpage Interaction
    Create a new flash file and add four components: Two textinput instances named user and PWD, one ComboBox component named grade, one button named btnsubmit and programmed under btnsubmit:

    Code
    On (Release)
    {
      // Define the URL for Interaction
      VaR Urlprefix = " Http: // localhost: 2056/website name/astest. aspx? Uid = " + _ Root. User. Text + " & Pwd = " + _ Root. pwd. Text + " & GRD = " + _ Root. Grade. getselectedindex ();
      VaR Myloadvars =   New Loadvars ();
    Myloadvars.txt = _ Root. User. text;
    Myloadvars. sendandload (urlprefix, myloadvars, " Post " ); // Sendandload Method
      // If the server returns data successfully, success indicates success and true indicates success.
    Myloadvars. onload =   Function (Success: Boolean)
    {
    If (SUCCESS)
    {
    If (Myloadvars.txt = " Return Value " ) // Here, the "return value" is the value returned by the response. Write () method of the. aspx file.
    {
    // _ Root. User. Text = this.txt;
    }
    Else
    {
    // _ Root. User. Text = _ root. Grade. selecteditem. label;
    }
    }
    Else  
    {
    // _ Root. User. Text = "error! ";
    }
    }
    }

    For more information, see http://www.klstudio.com/post/49.html
    (2) Use WebService to communicate with the website background

  • Flash has developed a separate data component for WebService called webserviceconnector, how to use this control, see http://blog.csdn.net/songthin/archive/2006/05/31/766808.aspx

  • If you do not use components to communicate With WebService, see http://www.klstudio.com/post/56.html (3) xmlconnector
    (3) communication between xmlconnector and website backend

  • For example.

    Now, let's sum up here, and thank you for your selfless efforts.ProgramPersonnel's work and sharing. Work first.

  • 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.