AIR Error #2037: "Functions called in incorrect sequence, or earlier"

01 10 2009
After a short quiet period I'm back today to tell you something about the AIR file object. While deploying a new version of my application I ran into some problems on other systems. AIR threw the error
#2037: "Functions called in incorrect sequence, or earlier"

Not really self-speaking, huh? Doing some debugging, I found out that the error was thrown at last line of the following code:

The problem is, that the File and the FileReference classes need to be initialized with a file path, otherwise every attempt to access a property will fail. Thanks to Mike Chambers who talked about this issue earlier. His blog post really helped me a lot. I fixed this issue by changing my code to the following:


This initializes the File object with the path of the application directory, which should be fine for all cases.

What is also interesting about this topic: the error only occured on a Mac OS X system, not on my Windows machine. Have not yet been able to test this under Linux.

//Update: I still encountered some problems using this mechanism. For some reason zfile contains no valid resource on Mac OS X. Just FYI ;-)

Bookmark AIR Error #2037: "Functions called in incorrect sequence, or earlier"  at del.icio.us Digg AIR Error #2037: "Functions called in incorrect sequence, or earlier" Mixx AIR Error #2037: "Functions called in incorrect sequence, or earlier" Bloglines AIR Error #2037: "Functions called in incorrect sequence, or earlier" Technorati AIR Error #2037: "Functions called in incorrect sequence, or earlier" Bookmark AIR Error #2037: "Functions called in incorrect sequence, or earlier"  at Furl.net Bookmark AIR Error #2037: "Functions called in incorrect sequence, or earlier"  at blogmarks Bookmark AIR Error #2037: "Functions called in incorrect sequence, or earlier"  at Ma.gnolia.com wong it! Stumble It!

Working with custom font faces in AIR and HTML - fail!

10 09 2009
Since CSS2 many browser began supporting the @font-face CSS selector for embedding downloadable fonts. WebKit already supports this feature for more than 2 years. Today I tried to embed a custom font in my AIR application with negative results. In my HTML based application the font cannot be loaded or applied to the contents. For now I cannot find any information about this on the Adobe developer centers, neither I can find anything on Google. I found out that embedding custom fonts is allowed in Flex but for any reason, in HTML it is not.

Here's my CSS I used:

Any ideas are appreciated. I'll see if I can find out something further.
 

Bookmark Working with custom font faces in AIR and HTML - fail!  at del.icio.us Digg Working with custom font faces in AIR and HTML - fail! Mixx Working with custom font faces in AIR and HTML - fail! Bloglines Working with custom font faces in AIR and HTML - fail! Technorati Working with custom font faces in AIR and HTML - fail! Bookmark Working with custom font faces in AIR and HTML - fail!  at Furl.net Bookmark Working with custom font faces in AIR and HTML - fail!  at blogmarks Bookmark Working with custom font faces in AIR and HTML - fail!  at Ma.gnolia.com wong it! Stumble It!

Disable AIR's login dialog when using XMLHR with HTTP basic authentication

30 08 2009
While developing an AIR application which uses an online API with HTTP Basic Authentication I experienced issues with AIR's authentication dialog.

For doing the authentication I generated a HTTP authentication header including the login credentials. I appended this header to my XMLHttpRequest. In case the login credentials were correct, everything was fine and the request could be completed successfully. But if the credentials were wrong, AIR showed up with a login window to enter the login data for the given domain. Since most AIR applications will be a fully integrated user experience, I'm sure this would be a drawback for most developers. Another interesting point is, that the login box showed up even before I got notified about an 401-HTTP status response.

Continue reading "Disable AIR's login dialog when using XMLHR with HTTP basic authentication"


Bookmark Disable AIR's login dialog when using XMLHR with HTTP basic authentication  at del.icio.us Digg Disable AIR's login dialog when using XMLHR with HTTP basic authentication Mixx Disable AIR's login dialog when using XMLHR with HTTP basic authentication Bloglines Disable AIR's login dialog when using XMLHR with HTTP basic authentication Technorati Disable AIR's login dialog when using XMLHR with HTTP basic authentication Bookmark Disable AIR's login dialog when using XMLHR with HTTP basic authentication  at Furl.net Bookmark Disable AIR's login dialog when using XMLHR with HTTP basic authentication  at blogmarks Bookmark Disable AIR's login dialog when using XMLHR with HTTP basic authentication  at Ma.gnolia.com wong it! Stumble It!

AIR does not validate installed files against signature?

27 08 2009
While doing some security tests to an AIR application I'm currently developing, I stumbled over a strange behaviour. In the AIR documentation, Adobe says:
Each AIR application is signed, and an installed application cannot run if any files in the installed application directory do not match the application’s signature.


That - at least I thought so - means: if any of the installed files of an application gets modified or removed, the AIR framework will prevent the application from being run. But it doesn't. I modified some JS file of my application, added some alerts and the application just executes fine and also displays those "illegal" alerts. Removing some installation files doesn't seem to make AIR care about, too. Even if I remove the signatures.xml file from the application's META-INF directory, which holds all file signatures, AIR just feels fine and executes my application without any note.

Now I am wondering why modifications to the installation files have no effect on what AIR does with the application. Does this validation only work on "proper" certified files and validation will be skipped if the application if signed with a self-signed certificate? Hope anyone has an idea about this? I'll try to contact Adobe to get some information about this topic.

Bookmark AIR does not validate installed files against signature?  at del.icio.us Digg AIR does not validate installed files against signature? Mixx AIR does not validate installed files against signature? Bloglines AIR does not validate installed files against signature? Technorati AIR does not validate installed files against signature? Bookmark AIR does not validate installed files against signature?  at Furl.net Bookmark AIR does not validate installed files against signature?  at blogmarks Bookmark AIR does not validate installed files against signature?  at Ma.gnolia.com wong it! Stumble It!

Reading Application Information in HTML based AIR Applications

07 08 2009
So here it is, my first real post on my new blog. Hope you enjoy!

Adobe® AIR™ offers a lot of great features. However, developers, building AJAX-only applications using HTML and JS often may suffer from the lack of documentation. The AIR API reference for JavaScript developers is mostly complete in term of AJAX developing AIR apps but also lacks some common features.

This is an issue which may point to the fact that most AIR applications will be developed using Flex/ActionsScript. Since I develop a large application in JavaScript and HTML I had to solve some issues and more so I'll share this knowledge with you ;-)

My first posting leads me to a simple but useful snippet which allows you to read application information stored in AIR's application descriptor. For example if you need to reference the version of your application somewhere in your code, you can use my construct.

Continue reading "Reading Application Information in HTML based AIR Applications"


Bookmark Reading Application Information in HTML based AIR Applications  at del.icio.us Digg Reading Application Information in HTML based AIR Applications Mixx Reading Application Information in HTML based AIR Applications Bloglines Reading Application Information in HTML based AIR Applications Technorati Reading Application Information in HTML based AIR Applications Bookmark Reading Application Information in HTML based AIR Applications  at Furl.net Bookmark Reading Application Information in HTML based AIR Applications  at blogmarks Bookmark Reading Application Information in HTML based AIR Applications  at Ma.gnolia.com wong it! Stumble It!