Adobe Integrated Runtime (AIR) for JavaScript Developers Pocket Reference

(nextflipdebug5) #1

12 | Chapter 1: Introduction to the Adobe Integrated Runtime (AIR)


This low-level integration also applies to the script engines
within Adobe AIR that run ActionScript and JavaScript.
Adobe AIR provides script bridging between the two
languages and environments, which makes the following
possible:



  • JavaScript code can call AIR, Flash Player and Action-
    Script APIs

  • ActionScript code can call JavaScript APIs

  • ActionScript code can directly manipulate the HTML
    DOM

  • Event registration both ways between JavaScript and
    ActionScript


Note that the script bridging is “pass by reference.” So when
passing an object instance from JavaScript to ActionScript
(or vice versa), changes to that instance in one environment
will affect the instance in the other environment. Among
other things, this makes it possible to instantiate and use
Flash Player APIs directly from JavaScript, or to register and
listen for events.


This low-level script bridging between the two environments
makes it very easy for developers to create applications that
are a combination of both HTML and Flash.


TIP
Accessing ActionScript and Adobe AIR APIs from JavaS-
cript is covered in more detail in Chapter 3.

The end result of all of this is that if you are a web developer
using HTML and JavaScript, then you already have all of the
skills necessary to build an Adobe AIR application.


Adobe AIR Functionality


If Adobe AIR did not provide additional functionality and
APIs and simply allowed web applications to run on the

Free download pdf