As a Flash developer who’s been working with Flex and ActionScript 3 since late last year I really couldn’t bring myself to use the Flex Builder Eclipse plug-in. This down to my addiction to TextMate, in my opionion it simply out classes the competion. As a result I’m responsible for TextMate’s ActionScript 3 and Flex bundles.

At the moment the bundles are in the review section of the TextMate Repository. Once installed the bundle help covers how to set up (primarily to download the flex sdk) and outlines the non-obvious commands.

The main highlights of the bundles are:

  • MXMLC and FCSH Build Commands.
  • Function, Tag, Import Auto Completion.
  • ActionScript 3 and Flex documentation search.
  • Drag and Drop of imports, includes, embed assets, css, xml.
  • ASDoc Support.
  • MXML Validation.
  • Manifest Generation.
  • Class and Component Templates.
  • Flex Builder compatible project creation.
  • Unused Import statement removal.
  • Shortcut Key Super Class, Code Behind and Import file opening.
  • Thanks to the following people who have all had a hand, although they may not know it, in the creation of the bundles:

  • Daniel Parnell
  • Theo Hultberg
  • Mark Llobrera
  • Joachim
  • ChromaticRain
  • Thomas Aylott
  • For those of you who don’t use subversion the following zip’s can be downloaded, but they won’t necessarily be the latest version :

    ActionScript 3 Bundle
    Flex Bundle

    27 Responses to “TextMate ActionScript 3 and Flex Bundles”

    1. Marcin Says:

      Could you create a zip file or sth similar instead of this subversion respository? It would be much easier to download.

    2. Chad Says:

      Thanks for working on the Actionscript 3 bundle for Textmate! It sounds great. I have a request though. You have a few filenames in the bundle that are giving me difficulties when I’m trying to download. I’m using E-TextEditor on Windows and some files like “Getter:Setter” are not valid (I also saw a file that has a question mark in it). E-TextEditor is a great editor that works off the textmate bundle system. Most everything is compatable that I have worked with from Textmate to E. Would you mind changing these few filenames to keep compatability issues minimal?

    3. Christoph 'freelanders' Landers Says:

      I bought me a small Ruby book and startet do develop a completition-command that shows properties/methods of self-written classes in a popup on dot+tab

      short demo:
      http://screencast.com/t/JFxSYbzp

      download:
      http://www.bewegtbildgestalter.de/index.php?s=file_download&id=20
      [put the instrinsic-classes-folder in Users/Shared/]

    4. Joachim Says:

      tnx !

      1 question and 1 correction ;-)

      q : I have a script which used to invoke the shell-script in the bundle to update as 3 library’s. But i yesterday discovered that this script is no more available. And I have no old as3-bundle copy anymore. Could you send me the script, so I can rewrite my script and publish it.

      c : my website is now http://www.4d.be instead of http://4d.ratubagus.net .

      tnx and keep on doing the good stuff !!

      Joachim

    5. simon Says:

      Marcin - The only way to get the most up to date version of the bundles is via the repository, however I’ve added zips for download:

      ActionScript 3
      Flex

      Chad - The filenames have been changed so they’re fine to use on a PC.

      Christoph - Nice Work !

    6. jeff Says:

      I love this bundle! It Rocks!
      with the new revision, I am getting “parse_mxmlc_out.rb:31:in `+’: can’t convert nil into String (TypeError)” when compiling. I believe it occurs when there are errors and they are trying to be displayed.
      Any help is appreciated.

    7. Niko Says:

      I did some Ruby learning last night and came up with an Eclipse-like Organize Imports command. Works for all .as files in the current TextMate project, so in this version it is necessary to drag the intrinsic classes to the project window.

      The code is no doubt ugly as hell but let me know if you’d like to see it nevertheless. ;)

    8. Simon Says:

      Jeff - Glad you like the bundle! I can’t recreate the problem you’re getting, I expect there’s a regex problem formatting mxmlc output. Until I work it out it’s possible to revert back to the previous python script by finding the following line in the build command:

      -optimize=true 2>&1 | parse_mxmlc_out.rb;

      and changing it to:

      -optimize=true 2>&1 | parse_mxmlc_out.py;

    9. Folletto Malefico Says:

      It’s amazing: I’ve just uploaded a little bundle (FlexMate) I’m using, and then I found this post. :D

      I’d like to use it - my Bundle can’t compete - but the current AS3 bundle here (downloaded by SVN) raises some issues for my usage style…

      1. It sets a too high bar to start. It expects a saved project. Why? Mine just takes the current “project” and assumes it’s correct. It still makes some assumptions, but I shouldn’t have to make a project in order to compile MXMLC (I’m compiling directly AS files to SWF). I think you should allow “compile with assumptions” without a project (and giving errors, if anything is wrong) and allow customization if you’ll save one.

      2. It doesn’t integrate with the FDB debugger. I’ve a task called “Make & Debug”, that spawns a Terminal window and runs FDB from there. I’ve found the Debug menu, but it doesn’t help (I can’t manage to get it working - maybe because I’m using Tiger?).

      3. I don’t know since I can’t run it without creating a project (I can’t atm), but reading the Help: why didn’t you execute the TextMate builtin script in order to load the PATH environment? Again, I shouldn’t have to set another variable to do that, or use predefined directories. :)

      I was really excited whan I found it, but at the moment it seems to me filled with usability issues. It doesn’t “just work”. ;)

      I might help, at least adding the two features I’ve developed for my own use… and maybe working out those issues… since I’m sure that those problems are there in order to give more power to the Bundle, but they’re also limiting the ease of use. I think that everything could be perfect for everyone. ;)

      Please, take anything you need from the very humble bundle I’ve linked above, and don’t hesitate to contact me if you want to collaborate. :)

    10. Simon Says:

      Folletto - Thank you for the feedback and I’m glad you found the bundle. As it’s still in review by the TextMate community I’m more than happy to make changes that make it easy to use and understand. In response to your points:

      1. Did you see the “Compile Current Class…” command? It should do what you need as it operates on the current file and isn’t project dependent.

      2. You’re right! It doesn’t, and it should. I’ve been looking at your bundle for inspiration on this…. and hope to add something soon.

      3. The majority of the bundle commands do use the $PATH if it’s been set, the main exception is the documentation command as the doc’s aren’t found in the bin. The point of using the predefined directories was to try and solve the “where’s the flex sdk” question before getting the user involved.

      The main point of interest to me with your bundle is that you’re using the ScriptMate style approach. One of my TODO’s is to try and get this working interactively with fcsh - rather than running it “blind” through the Terminal or iTerm.

      Cool stuff!

    11. danilo Says:

      I just downloaded and installed the bundle on TextMate. But I can’t set the path for the main classes.

      I’ve read the help and set a shell variable but it doesn’t work. Any ideas?

      feel free to reply via mail!

    12. William Says:

      Hey Simon,

      I really love this bundle!

      It works great, except for one thing. Whenever I attempt to build something, iTerm crashes on me, so I have to go to do my building manually right now. I’m using the latest version of the bundle from the macromates SVN repo. Have you seen this happen? Any suggestions?

      Thanks,

      William

    13. William Says:

      Seems as though it is some issue with the applescript related to iTerm. BTW, I’m running 10.4. I just edited out the call to the fcsh build scripts and it’s working fine. It looks like you get a lot of pretty useful info from fcsh, however, so I’m looking forward to using this when I switch over to 10.5.

      BTW, does this hook in the the flash debugger version at all, and it what ways?

    14. Simon Says:

      Danilo - As long as you have set the TM_FLEX_FILE_SPECS shell variable correctly you shouldn’t have any problems. The best way to see how to set up a project is to create one using File > New from Template > ActionScript 3 > Project - ActionScript 3.

      William - I know I haven’t kept up to date with the latest iTerm builds so that may be the cause of the problems. I’m now working from Leopard and Apple have improved the terminal enough to use it instead. FCSH is a great time saver, especially on large projects, but other than that it is simply a wrapper for mxmlc.

      There’s work in progress regarding running fcsh inside TextMate, along with launching FDB.

    15. Travholt Says:

      I get the following error when trying to svn co this bundle:

      subversion/libsvn_subr/utf.c:466: (apr_err=22)
      svn: Can’t convert string from ‘UTF-8′ to native encoding:
      subversion/libsvn_subr/utf.c:464: (apr_err=22)
      svn: ActionScript 3.tmbundle/Commands/Insert Color?\226?\128?\166.tmCommand

      Seems like you have used an ellipsis (…) instead of three underscores in the file name, and this is preventing me from checking out the bundle with svn.

    16. Simon Says:

      Travholt:

      This should solve the problem. Specifically: 5.7.2 Setting LC_CTYPE

    17. Travholt Says:

      Yup, that was it. Actually I think I once did the same thing on my other computer, but that was ages ago … Anyway, thanks!

    18. alinear Says:

      With a clean install of TextMate + AS3Bundle on a clean install of Mac OS 10.5.2 … I get this prompt whenever I try to launch (add) the bundle:

      “The bundle “ActionScript 3.tmbundle” does not contain the required “info.plist” file (or that file is corrupt) and can therefore not be installed.”

      The flex bundle seemed to work… not sure what to do from here…

    19. Simon Says:

      alinear:

      It looks as though my automated script for exporting and zipping the bundles hung half way through the ActionScript 3 bundle export - so only half the bundle was included in the zip you downloaded. This has now been rectified.

    20. nemoDreamer Says:

      thank you.
      thank you SO much for this indispensable bundle!
      i made the transition to AS3 yesterday, and am discovering a world of consistency :):):)
      question: how can i get the project to use the …-config.xml in “build/”? i tried the custom compile, which told me “/build/compile.sh not found/executable”.

      ok, before i posted this comment, i decided to do some research on permissions (being new to OS X shell deliciousness). might be a good idea to add to your help file that for custom compile, you need to execute

      chmod -x ./build/compile.sh

      i’m still mighty confused by the contents of that file, though…
      where does it get TM_BUNDLE_SUPPORT and the other path variables from? do i need to set all those manually? in TextMate preferences, or in my system? or does Textmate do that for me?

      today is help a poor shell-noob day :)

    21. steve Says:

      FlashDevelop > TextMate

    22. The Flash Art of War » Blog Archive » Flex SDK & Textmate Says:

      [...] want a light weight editor that can quickly get you up and running, especially on small projects. Here is a good tutorial to help you get [...]

    23. Andrea Passaglia Says:

      Your work is very appreciated.

    24. The Flash Art of War » Blog Archive » 1st NYC Flash Meetup Says:

      [...] FDT Setup (w/ Flex SDK) Text Mate Setup Project Organization The New York Flash Meetup meets once a month so if you are in the NYC area [...]

    25. Rich Says:

      Any plans to update the flex bundle to Flex 3? Not sure what’s different but there are bound to be issues, right?

    26. Simon Says:

      Rich:

      Although there’s likely to be additions to the the classes and methods used in Flex 3 I’ve not yet been through the code and added them. You can use the Flex 3 SDK without any problems as I have updated the appropriate commands in the the ActionScript 3 Bundle. However, at the moment, you have to manually override the environmental variable TM_FLEX_PATH and point it to the flex 3 sdk directory for this to happen. You can do this globally in Preferences > Advanced > Shell Variables or on a project by project basis via the Project Information panel reached via the i button in the project file draw.

    27. The Flash Art of War » Blog Archive » flashlog.txt for trace(); Says:

      [...] I had the Debug Player installed, I set all this up with Textmate and the excellent bundle from here. Here are a few screens from the debug the options you need to click on to get it [...]

    Leave a Reply