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!

Trackbacks


No Trackbacks

Comments

Display comments as (Linear | Threaded)
No comments

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA