Ben Reynhart

Geekin' it up

Notes

Migrating from Flash IDE to Flex SDK with TextMate

On the latest project I have been working on, I have decided to take the leap to step away from the Flash IDE for compiling my Flash SWF. I’ve hit a couple of gotchas and problems that have taken quite a bit of my time and insider knowledge to fix. I consider myself to be fairly experienced at ActionScript development, and these issues are far from obvious for the budding Flash IDE designer/developer.

Configuring the latest FLEX SDK (4)

  1. Download the latest Flex SDK - http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk
  2. Extract it to the folder (create it if doesn’t exist) - Macintosh HD/Developer/SDKs/
  3. Rename the folder to “flex_sdk_3”, so it looks like - “Macintosh HD/Developer/SDKs/flex_sdk_3”.

Setting Up TextMate Actionscript 3 Bundle

Download Simon Gregory’s brilliant Actionscript 3 bundle for Textmate

http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/

The following is an excellent guide for setting up a new project in TextMate

http://www.pixelate.de/blog/setting-up-a-as3-project-in-textmate

TextMate will now create the correct folder structure and template files for your project for use with the Flex SDK - start a new project to see. File > New from Template > ActionScript3 > Project


So you’ve got it all setup, but your getting errors when you compile your project..


Error about not having a ‘super()’ call in constructor

Look into your src folder for the Project-config.xml file and open it. This is the project-specific Flex compiler settings, change the setting:

<compiler>

<warn-no-explicit-super-call-in-constructor>false</warn-no- explicit-super-call-in-constructor>

Can’t display regular Flash Button in the compiled SWF

This is because the Button class is not part of the default class packages for the Flex SDK, it’s native to the Flash IDE.

There are work-arounds, such as:

  • Creating your own buttons using MovieClips / shapes and textfields
  • Use the native Flex buttons & components if you are happy creating a mxml document

Or you could use a sneaky method that lets you export the Classes straight from the Flash IDE in a .SWC which you can then include in your library path.

More information on this method at Josh’s Blog

No factoryClass specified 

Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries.

Look into your src folder for the Project-config.xml file and open it. This is the project-specific Flex compiler settings, change the setting:

Undernearth the flex-config node, add the following line

<flex-config>

<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>

ALSO…..

If you get other compile errors, make sure there are no SPACES in the folder/file path!

Hope this is useful!

Filed under flash actionscript Flex SDK Textmate