Use ASP technology in Flash

Source: Internet
Author: User
Conditions required for using ASP in flash:
1. Your ISP Server must support Active Server Pages and preferably databases.
2. You should install flash 4
3. You need a preliminary understanding of ASP.
OK. The following describes how to use it:
The first step is to create a database:
Database Structure:
In this example, an Access database is used. The table name is tblstaff and has three fields: Strid (automatic number), strknownas (text), and strsurname (text ). this is a database used to demonstrate the user name. Just add some data.

Step 2 is to create an animation for flash 4:

The procedure is as follows:

1) create three text fields. They are used to display data;

2) set the name of the first text field to input, which is used to receive input data;
3) the other two text fields are named knownas and surname respectively;

4) set the default value for other settings first;

5) Finally, select a button (it should be a reusable component scrollbarbutton) from the flash library ). This is an important step. The button will pass the input variables to the ASP page, and click the action page on the properties of the button. click "+" and on mouseevent. check the release box;

6) Click "+" and load/unload movie again. select "load variables into location" and enter your asp File Name (for example, Flash. ASP ). select target;

7) Finally, select "Send using post" in variables, click "+" to set the variable, and enter "input" (the name of the first text field) in the variable input box ), after all the above work is completed, you should see the following content in the Action box:

On (Release)

Load variables ("flash. asp", "", vars = post)

Set variable: "input" = ""

End on

In this way, when this button is clicked and released during the animation process, the content in the input box will be passed to the Flash. asp file.

Note that form uses the POST method to pass variables;

8) Create an HTML page that contains the Flash Animation file.

Step 3: ASP file code:

Note that the writing method for passing knownas and surname back will be as follows:

Knownas = data1 & surname = data2

Use server. urlencode (variablename) to ensure that the variables passed in the past are encoded according to the URL format.

The following describes the principles of ASP and Flash Communication:

Variables are actually transmitted to flash through URLs. In fact, this is a get method. You can also pass variables to a SWF file without using ASP, As long:

The text "text of my variable" will appear in the position specified in the Flash animation.

Now, for ASP developers, they only need to prepare the data required by flash and then use the animation function in flash to make a powerful webpage. the simplest is to use flash in combination with the database to draw a beautiful pie chart. as long as you can imagine, you can make a lot of good things.

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.