Archive

Posts Tagged ‘code’

Loading and Saving External XML Data in AIR (Apollo)

July 3rd, 2007 Fraser Crosbie 4 comments

I just finished an AIR (Apollo) application that loads and saves data from an external XML file. I figured I would share the code to accomplish this task as there is not a lot of Apollo info around at this time.

First off lets start with loading an XML file and reading its contents. I realize that there are much easier ways to load XML into Flash than this, but the advantage here is that I can use File.applicationResourceDirectory which allows me to target the installation directory for the XML file that was included with the AIR package. In this snippet I am using the synchronous open method. This essentially pauses everything else in the Flash movie until it has completed its task (opening the file).

Read more…

Firefox with wmode ignores Key.isDown()

March 8th, 2007 Fraser Crosbie 1 comment

I am sure this is old news to many of you, but today was the first time I have run into this issue. I am working on a site for a client that has very high accessibility requirements. I originally built my project to be controlled using the mouse and was asked this morning to add the ability to navigate it using the arrow keys of the keyboard. It only took me a couple minutes to get this functionality working in Flash, but when I tested it using Firefox I was not getting any response from the keyboard. I tried it out in IE7 and everything worked like a charm. After a couple minutes of searching I came across this site and found my solution. Apparently Firefox always returns the Key.isDown() function as false if you have wmode=”transparent” or wmode=”opaque” in your html object and embed tags, but if you use Key.getCode() everything works perfect.

Here is a snippet of code showing the workaround to this issue:

Read more…

O’Reilly Code Search

September 10th, 2006 Fraser Crosbie No comments

O’Reilly’s has recently launched a search engine that will scour through nearly 700 of their books, including over 123,000 individual examples, composed of 2.6 million lines of code. I think O’Reilly has published around 21 ActionScript related books at this time.

http://labs.oreilly.com/code/

Categories: Flash Development Tags: ,