Job Recruitment Website - Job seeking and recruitment - Hundreds of Programmers: What exactly is programming?

Hundreds of Programmers: What exactly is programming?

Because it is a text file, you can edit it with any text editing tool and save it anywhere.

If you want to use AS to control Flash elements, you must associate AS code with Flash according to certain rules. Generally speaking, there are four ways to ASsociate as code with Flash.

First, writing code on the framework of Flash is the most intuitive and easy to use.

Second, write the AS code into the external script file, and then insert it into the framework with the #include keyword.

Thirdly, associating external AS scripts with Flash components is suitable for those situations that need to draw complex images in the Flash creation environment.

Fourth, write it as code into external class scripts, and then introduce Flash with document classes. This is the coding method recommended by AS3. If you are interested in becoming an AS programmer between A Niu and Niu C, please practice this method more.

The following is an example of the introduction of the last three scripts.

Import with the #include keyword:

(1) create a HelloWorld.txt, edit it with notepad, and write the code on it: trace("Hello World! " ) );

(2) change the extension of the newly created HelloWorld.txt to. As.

(3) Start Flash, create a new Flash file (ActionScript3.0), and save it in the directory where HelloWorld.as is located.

(4) Select the first frame of the Flash file, then press F9 to open the script window, and enter: include "helloworld.as";

(5) Press Ctrl+Enter at the same time to test the movie.