JavaScript is the name of an object-oriented scripting language that is used to control web browsers when developing web applications and dynamic websites. The JavaScript code is either added to an HTML page or a separate .js file is linked from an HTML page.
JavaScript is ECMAScript-compliant and is also sometimes used in the ActionScript code of Adobe Flash Professional projects to control behavior of browsers from within a SWF file at runtime. You can also generate and hand-code JavaScript using the Code view in the Document window of Adobe Dreamweaver.
<script language="javascript">
function getFlashContent( name ) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[name];
} else {
return document[name];
}
}
function init()
// add code here...
}
</script>
While JavaScript was designed to look similar to Java scripting language, it is not to be confused with Java programming or JavaBeans. The JavaScript language is much easier for nonprogrammers to understand. ActionScript 3 uses many conventions commonly associated with JavaScript, so developers who learn either language can quickly begin coding with the other language. Both JavaScript and ActionScript use the dot syntax.
To learn more about working with JavaScript in Flash projects, read the article titled Integrating Flash content with the HTML environment.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
Flash User Forum |
More |
Flash Cookbooks |
More |
| 02/08/2012 | Digital Clock |
|---|---|
| 01/18/2012 | Recording webcam video & audio in a flv file on local drive |
| 12/12/2011 | Date calculations using 'out-of-the-box' functions |
| 11/08/2011 | Easer - custom ease transition for tween tools |