Introduction to ActionScript 2.0
Those of you who have been coding with earlier versions of Flash such as Flash MX or before will find this section very useful; it covers some of the differences and advantages in ActionScript 2.0.But not to worrythose of you still wanting to code in ActionScript 1.0 (Flash MX style coding) still have this option as you can see in Figure 8.2. Go to the publish settings; choose File>Publish Settings (Ctrl+Shift+F12), choose the Flash tab, and choose ActionScript 1.0. Be warned, it's not only possible, but likely that you will run into conflicts using ActionScript 1.0 with ActionScript 2.0 anywhere in the file. You can also see which version of ActionScript you are running in your file by selecting the stage and viewing the Properties Inspector as in Figure 8.3.
Figure 8.2. Use the Publish Settings dialog box to set which version of ActionScript you would like your file to support.

Figure 8.3. Use the Properties Inspector to quickly see which version of ActionScript you are using.

In ActionScript 2.0, you would write this:
var myVariable = "test";
trace(MYVARIABLE);
//Output: test
It is the same when passing parameters into functions:
var myVariable = "test";
trace(MYVARIABLE);
//Output: undefined
As you can see, in ActionScript 2.0, the preceding code would return undefined. So remember to always check your letter casing.
//create the function
function myFunction(sample){
trace(SAMPLE);
}
//call the function
myFunction("testing");
//Output: undefined
Declaring Variables and Instance Names
Other features of ActionScript 2.0 that bring it more in line with ECMA standards are shown in Table 8.1.