1 Reply Latest reply on Jul 28, 2008 3:25 PM by Joe ... Ward

    Air variable not working

      Hello everyone! I just started playing with AIR today, and so far it's really fun. I've run into a slight problem though, it seems that every time I try to use any kind of air function, like "air.NativeApplication.close()", I get an error message in the terminal: "TypeError: Value undefined (result of expression air.NativeApplication.close) is not object.
      onclick at app:/application.html : 50" I have AIRAliases.js included in the file, so I'm not exactly sure what's going wrong. Any ideas?
        • 1. Re: Air variable not working
          Joe ... Ward Level 4
          There is no air.NativeApplication.close() method.

          The closest thing is: air.NativeApplication.nativeApplication.exit()

          The NativeApplication object is a bit unusual in that you cannot create one -- it is created for you automatically. To get a reference to the object that AIR created, you use a class (aka static) property. To use a class property, you use the name of the class, in this case, "NativeApplication," with the name of the property, "nativeApplication." Hence, the seemingly redundant construction: