A couple of days ago I ran into a bug with ExternalInterface which caused me quite a hassle (a couple of people ran into it before I did). I finally figured it out, and wanted to post here in case anyone else runs into it.
Basically, if the data being passed from JavaScript to ActionScript or ActionScript to JavaScript via ExternalInterface contains any line returns (\n) then the string is not serialized correctly, and the call will fail (you will probably see a JavaScript error). This affects both Flash Player 8, and the Flash Player 8.5 alpha.
In this post, I am going to provide all of the links you need to get started with compiling ActionScript 3 and Flex 2 / mxml from the command line (on Mac, Windows and Linux). I have had to send this info out in about 3 different emails today, so I figured I would post it here to get everything in one place.
Remember that both ActionScript and mxml / Flex files are text based, so you can use any editor that you want, and with mxmlc compile on virtually any system that you want to (although the alpha is currently only officially supported on Windows).
I have been doing some work with JavaScript / Ajax lately, and found myself needing to parse some XML (something I do quite often when building apps). However, I have not had much luck successfully parsing XML with JavaScript cross browser.
Firefox 1.5 has support for E4X, which makes parsing a breeze, but it is only supported in the latest version of Firefox. The XMLHttpRequest object parses loaded XML into a DOM, but my experience has been that the DOM is different depending on the browser you are running in (I tested on Firefox and Sarafi on Mac).
I have been doing most of my work recently using ActionScript 3 and the Flash Player 8.5 public alpha. However, I recently had to do some Flash Player 8 / ActionScript 2 work, and ran into the issue of switching the Flash Player version installed on my machine. Of course, I could just install / reinstall players as I need them, but that it tedious, and doesn’t lend itself to quickly switching back and forth between player versions (especially during the same session). So, I put together a simple bash script that will quickly switch between player versions (for Firefox and Safari).
I finally switched back to Mac from Windows yesterday. I had moved to Windows a couple of months ago so that I could use the Flex Builder 2 alpha. However, after my 4th system failure in the past 3 months, I decided it was time to go back to Mac.
One of the first things I wanted to set up was my development environment so that I could continue to develop in Flex 2 and ActionScript 3. We do not currently have a Mac version of Flex Builder, but fortunately, the command line compiler (mxmlc) included with Flex builder is written in Java, which means it should (and does) run on Mac and Linux.
There has been quite a lot of confusion this week over one of the items in the Adobe / Macromedia acquisition FAQ. Specifically, the following question:
What are Adobe’s plans for Flash Player and Adobe Reader?
was not worded well initially. Quite a few people in the community interpreted the answer as saying that the Flash Player and Acrobat Reader were going to combine into one uber web browser plugin.
That is not correct.
I have uploaded a beta version of the soon to be renamed Macromedia News Firefox extension that (kind of) works with Firefox 1.5.
There are some significant known issues with this build, so I am not adding it to the main extension page. You can only download it from here.
Download Macromedia News Firefox Extension Beta
I had hoped to fix all of the issues before posting it, but decided to post it for two reasons:
A lot of people have had questions about whether you can use the Flex 2 Framework classes / controls (everything in mx.*) within an ActionScript 3 project without using any MXML.
You can definitely do this, and we have posted some info on the labs wiki that shows how (written by Gordon Smith).
You can view the info here.
You can download Flex Builder 2 and ActionScript from labs.macromedia.com.
Mark Anders has made a post detailing some of the new features that have been added to Flex Builder 2 internal builds recently.
Features / changes includes:
Another thing that is in this build, but that Mark didn’t mention was improved compile times. Incremental compile time have been significantly improved. We are still working on compiler performance, but just this single change makes a HUGE difference.
Just noticed this, but there is an ActionScript 2 to ActionScript 3Migration reference up on Labs.
This is a great reference to get an overview of some of the changes.
You can view the reference here.
You can download the Flex Builder 2 alpha and start playing around with ActionScript 3 from here.
Note that it looks like a huge document, but a lot of the changes are just APIs moving into a package (as part of the general API clean up).