Accessibility

ActionScript cookbook beta

Create an untyped variable

Problem Summary

You need to create a variable to store a value.

Solution Summary

Use the var keyword to declare a variable.

Explanation

ActionScript 2.0

var s = "I am a String";
var i = 5;

ActionScript 3.0

var s = "I am a String";
var i = 5;

Note: Just as in ActionScript 2, you use the var keyword only the first time you declare the variable.