Sans Browser

Core SWF: Flex/AS3 for Xcode

July 28th, 2008 by enefekt

Since Xcode 3 has come out I’ve been tinkering with different ways to keep development with Flex and ActionScript 3 working decent for my day-to-day work.

In order to keep this stuff updated better and available for others to use, and hopefully help improve, I’ve created a Google Code project named Core SWF.

Right now this doesn’t have a whole ton of stuff, but it does have:

  • Updated ActionScript and MXML language spec files (Including AS in MXML script blocks)
  • A basic ActionScript 3 project template (Integrated with the Flex 3 SDK Ant tasks)

Gradually I’ll be adding more advanced project templates.

This is all updated to work with Xcode 3.1 as well.

You can download the very first 0.1 release on the project site.

Ping me for SVN access if you want to help add or improve some stuff. enefekt at that Google email service.

Filed under: ActionScript, Adobe, Flex, MXML, Mac, Xcode

16 Comments

  1. Bryan Bartow Says:

    Unfortunately, I can’t get anything to compile. I’m getting what appears to be an mxmlc error as seen at: http://www.flickr.com/photos/bryanbartow/2712284492/

  2. enefekt Says:

    Hey Bryan. Thanks for the heads up, and the screenshot, very helpful.

    Looks like it may not be finding the Flex SDK.

    There is one thing I forgot to put in the READ ME file. Depending on the directory name of the Flex SDK, it needs to be changed in the Target definition in Xcode, it overwrites the one you see in the Ant file. I’ll have to make that less confusing.

    Just open the “Target” tree in the file organizer in Xcode, double-click on the target underneath that. Check to be sure the path in the argument matches where you put your Flex SDK dir:
    -DFLEX_HOME=/Developer/SDKs/flex_sdk_3.0.0.477_mpl

    Make sure that’s pointing to the real thing, and see if that works. Let me know how it turns out.

    If thats the issue I’ll need to update the READ ME to make this more clear.

  3. enefekt Says:

    Oh, I forgot to mention, with the AS3 project template, the “Build and Go” toolbar button should work too, and launch your app in your default browser.

  4. Ashvin Savani - Arckid Says:

    Will it show imported classes’ methods and properties while you are working in another classes? I mean, can it sense variable names etc., in autocompletion?

  5. enefekt Says:

    It will only show keywords and classes that are part of the Flex framework and Flash Player. The autocomplete is static, not dynamic.

    By default Xcode will autocomplete custom variables and such in the same file, but not across files.

  6. Bryan Bartow Says:

    @enefekt That was indeed the issue. Changed the target definition and it worked just fine. Very nice.

  7. enefekt Says:

    Thanks for the follow up!

  8. IvanK Says:

    Really cools stuff. It did work and compled the “hello world” app, but when I tried a bigger project – it failed. It’s probably some error from changing environments (it’s coded with flashdevelop), but the real problem is that it only said “mxml failed” without going into specifics. Is there a way to set up this thing so it has proper error descriptions?

  9. enefekt Says:

    Hey IvanK. If you click the “Failed” link in the far bottom right in the status bar you’ll get an error window. In the horizontal divider bar there, there is a button to see the build transcript.

    This will give you more information on why the build failed.

  10. IvanK Says:

    Isn’t there a way to do this with native xcode debugging or something, I’ve tried to dig in the documentation, but as I am new to both xcode and osx in general I’ve failed miserably at it.

    Anyway, 10x for the help, but what I am trying to accomplish here is a “flashdevelop like” environment in osx which proved quite an impossible task. And this debugging thing is a big part of it.

    If you don’t know of an obvious way to do this, I will try to search a bit and discuss it with the xcode guys because I really like osx, and using windows(flashdevelop) for “work only” is a bit demoralizing :) .

    As a side note – can you liven up the coreswf project – maybe add googlegroups or a wiki page would really help further the cause.

  11. Mitch Says:

    This is a great tool.

    Any way to make the target argument to be just
    -DFLEX_HOME=/Developer/SDKs/flex_sdk such that I can make it as an alias to point to whatever flex release number, 3.1 as of now?

  12. enefekt Says:

    Thanks Mitch! I’ve been meaning to update it. Hopefully I’ll get to it this fall.

    You can set up a mac alias or sym link to point to the current SDK like “flexSDK_current”, then you would just need to update the alias or symlink for an SDK update.

    Is that what you were talking about?

    IvanK: No easy way I think to do this with native Xcode debugging. Although MTASC reports errors with line numbers back properly to Xcode, so that it’s message bubbles stuff and error location stuff actually works. Wish the Flex SDK could do this.

    And, yes, I need to give CoreSWF some TLC. Hopefully soon.

  13. Dru kepple Says:

    Very cool; I once tried the old Xcode stuff a few years back and never got it to work. This worked pretty much the first time! I doubt I’ll give up TextMate but this is something I’ll definitely be giving a test drive.

    Thought I’d point out that the locations of the Project Templates and Specifications, in /Developer/Library/Xcode/, is not supposed to be the place to put your user stuff. Apple wants you to put that custom stuff in ~/Library/Application Support/Developer/Shared/Xcode/ (for user-level installation) or Library/Application Support/Developer/Shared/Xcode/ (for system-level)

    Works the same, and lets you keep the Apple-installed stuff separate.

  14. enefekt Says:

    Sweet Dru. Thanks for the tips on install locations. I’m still wanting to update this stuff.

  15. Edd Caine Says:

    Hey,

    Very nice work! It starts from an AS3 perspective – will MXML work as well? And do you think it’s possible to get the file templates in when you choose file->new file for MXML and AS?

    Many thanks
    Edd

  16. siddharth Says:

    hey there,

    any idea how this trick would work with mxml projects?

    suggestions/ideas will be appreciated

    cheers!
    Siddharth

ok2