Getting Started > What's new in Flash 5 ActionScript > Differences between ActionScript and JavaScript

Differences between ActionScript and JavaScript

You don't need to know JavaScript to use and learn ActionScript. If you know JavaScript, however, ActionScript will appear familiar to you. Some of the differences between ActionScript and JavaScript are as follows:

ActionScript does not support browser-specific objects such as Document, Window, and Anchor.
ActionScript does not completely support all of the JavaScript predefined objects.
ActionScript supports syntax constructs that are not permitted in JavaScript (for example, the tellTarget and ifFrameLoaded actions and slash syntax).
ActionScript does not support some JavaScript syntax constructs, such as switch, continue, try, catch, throw, and statement labels.
ActionScript does not support the JavaScript Function constructor.
In ActionScript, the eval action can only perform variable references.
In JavaScript, toString of undefined is undefined. In Flash 5, for Flash 4 compatibility, toString of undefined is " ".
In JavaScript, evaluating undefined in a numeric context results in NaN. In Flash 5, for Flash 4 compatibility, evaluating undefined results in 0.
ActionScript does not support Unicode; it supports ISO-8859-1 and Shift-JIS character sets.