Setting up an AS2 Development Environment in Eclipse

After SEPY crashed on me 4 times in a row, I decided to try my hand at setting up an AS2 development environment in Eclipse.

Here is a list of things that I love in SEPY, that I needed to have in Eclipse to make the transition acceptable:

  • Snippets: I’ve been getting used to using templates, but so far so good
  • Publish/Test Movie from Eclipse (ctrl+enter or the like)
  • Duplicate line

Here is what I’ve done to get the AS2 environment set up:

  1. Grab Eclipse (As of right now I’m still using 3.1)
  2. Install ASDT (AS Development Tool)
  3. Grab Mike Chambers FlashCommand (A command line tool for compiling fla’s)
    1. Add the build.xml ANT build file for FlashComamnd and set the parameters (Check out the detailed post to set up your build.xml file)
  4. Create your own templates for the ActionScript perspective or download and import mine
    1. Download AS2 snippets
    2. Importing Downloaded Snippets:
      1. From the main menu in eclipse select ‘Window’ -> ‘Preferences’
      2. Expand the ‘ActionScript2’ node
      3. Expand the ‘Editor’ node
      4. Select ‘Templates’
      5. Click the ‘Import’ button
      6. Browse to the file then click ‘Open’

Here is a list of things that I wish were available in Eclipse but sadly are not yet:

  • Select text -> drag and drop (copy/move) – This is in CFEclipse, but not ASTD or even the FlexBuilder plugin

Abbreviations (templates help with this one) – Huge timesaving feature in SEPY.

Using FlashCommand in Eclipse

Recently I pulled down Mike Chambers FlashCommand. FlashCommand is a command line compiler for the Flash IDE.

I wanted to set up an ANT build script to execute builds from Eclipse without having to alt-tab between programs (yes, I’m that lazy!).

Setting up the ANT script wasn’t too difficult, even for someone who knew the absolute minimum about ANT.

[xml]< ?xml version=”1.0″?>

Sample Build file for a project with FlashCommand, ANT

[/xml][Download the sample build script.]

Using Fiddler with Firefox

I recently encountered some issues with trying to debug a flash application that posted an XML packet to a URL. I first tried FireBug, it didn’t seem to be picking up the XML that was posted. After a quick Google search, I ran across a post describing how to use Fiddler (an IE based tool) with Firefox.

Check out the simple setup steps:

http://nil.checksite.co.uk/index.cfm/2006/4/12/Using-Fiddler-with-Firefox

Bonus! I was able to view the raw header and the XML data that was being posted.

NOTE: I have heard of some issues with having to have Fiddler open to browse in Firefox, but haven’t encountered it.

IE7 ActiveX Quick Fix

Michael Moore (no, not the documentary director!) brought this little IE 7 quick fix to my attention.

Just below the last in your HTML page, insert the following Javascript:

Open a new document in Notepad or your HTML editor, and copy & paste the following content into it:


theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++)
{
theObjects[i].outerHTML = theObjects[i].outerHTML;
}

Save this file as fixit.js

Pretty cool stuff.

For more control and some additional features there is SWFObject:

SWFObject is a JavaScript file used to embed Macromedia Flash content. The script can detect the Flash plug-in in all major web browsers. Its search engine friendly & degrades gracefully.

Check out SWFObject.

J.

Flash Video won’t work in IIS 6.0

I learned something today about Windows Server 2003 and IIS 6. Flash Video Files won’t stream at all. Hrm…fun. What is really nice is the Flash piece will play just fine, the video just won’t show up.

With IIS 6.0, Microsoft changed the way streaming media is handled. Previous versions of IIS did not require any modification to stream Flash Video. Microsoft IIS 6.0, the default web server that ships with Windows 2003, requires a MIME type to recognize that FLV files are streamed media.

So you have to add the MIME type in IIS…

  1. On the Windows 2003 server, open the Internet Information Services Manager.
  2. Expand the Local Computer Server.
  3. Right-click the local computer server and select Properties.
  4. Select the MIME Types tab.
  5. Click the New… button and enter the following information:
    • Associated Extension box: .FLV
    • MIME Type box: flv-application/octet-stream
  6. Click Ok.
  7. Restart the World Wide Web Publishing service.

You can view the entire Macromedia TechNote here.