in Actionscript 3

Using TextMate for ActionScript 3 Development

Over the last few days I’ve been checking out TextMate to see how useful it is for Flash development. I can now report that I’ve found the most versatile text editor in existence. There are so many possibilities with this tool simply because it’s so extensible. I plan on eventually doing a tutorial on using it but for now, here are some things that I’ve learned.

The first step is obviously to download the latest version of TextMate. From there you should download the ActionScript 3 bundle which adds a whole host of templates, commands, and snippets that will help you write ActionScript with ease. This blog post has all the details of installing it. After installing the bundle, you can unleash the real power of TextMate by modifying the bundle and adding your own commands and snippets.

I added a command that allows you to hit Cmd-Enter to automatically save your project and switch to Flash to test your movie. This based on a command in the old ActionScript bundle but I have modified it to fit my needs. You can see the details of how to setup it up in the screenshot below.

I highly recommend anyone on OS X to download this editor and check it out as I think I will be doing a lot of my coding in it from now on.


Write a Comment



  1. I’ve been using TextMate exclusively for the last 6 months or so, for writing all of my AS. So, I couldn’t agree more. Not sure how I ever did without it, honestly.

  2. Sounds nice. :)

    Since I’m a Windows user I’ve been looking at similar tools. Lately I fumbled a bit with FlashDevelop. I especially like the code hints for newer like Papervision3D 2.0. Also there is a big community behind this app which makes for good support.

    Any other Windows editors you’d recommend?

  3. And if you run Windows –

    TextMate is the award winning editor for MacOS X, that has revolutionized the way text editors work. By supporting TextMate bundles, e makes you part of a huge and vibrant community. Whatever task or language you need to work with, there is a good chance that someone has already made a bundle with all the needed adaptations.

    Haven’t had a chance to really test it, But looks good.

  4. Hi there,

    I’m just wondering, does Textmate auto-complete your classes and standard classes? Because last time i checked i couldn’t make this work. I don’t use Macs that often, so it might well be that I didn’t do it properly.

    You know if this is possible? It seems i’m not the only one:

    If this is true, i wonder where all the buzz about Textmate comes from, because if the best code editor for Macs _ever_ doesn’t auto-complete your classes… that’s disappointing!

  5. I’m already using TextMate for other kinds of web development, but I never really figured out how to use it for Actionscript. That compile command was great. Looking forward to your tutorial! Will you be talking about alternate compilers like MTASC?

  6. This is awesome, I can’t wait for the tutorial. I’ve been a huge TextMate fan for a while now, and never quite got the bundle to execute in flash correctly. Maybe you can also post on how to use MTASC to get textmate to code hint AS3.

  7. I am a big ignorant about Textmate – does it provide AS-specific code completion (both standard and custom classes)? What advantages does it provide over the Flex Builder to Flash workflow?

  8. Thanks for the tip, Ive been waiting for an excuse for using Textmate since I bought it on a whim a few months ago… Now! Have you got any advice on getting round procrastination?


  9. I love FlashDevelop for this very reason. If you have a FLA open in Flash and an .AS file open in FlashDevelop and you hit [CTRL]+[ENTER] it launches the FLA (which obviously includes testing the code you are working on.) Does TextMate give you “intellisense” insight into your custom classes? For example, when you have instantiated a new object in AS does it display all of your properties and methods?

  10. Great command Lee. I’ve been using TextMate for the last year and agree completely that it is the best “text editor” out there (I’m still partial to Coda for its more bundled project oriented features).

  11. I’ve been using TextMate and AS2/AS3 bundles for a year now and I won’t go back – and even Flex is not for me. Well, there’s no REAL TIME code hinting (as in FlashDevelop, Flex or FDT), but you can complete any function when it’s saved in TextMate’s vocabulary (you can easily extend it).

    Sure, you have to remember everything, but that’s ok for me – if you don’t remember something, you can open your AS code base as a TextMate project or press CTRL+H to find more information in internal Flash CS2 / CS3 help or at Adobe’s online help site.

    Soon I’d be glad to write a small tutorial for UX Mag with a small screencast, but for now if you want more information about AS3 development under TextMate (= no MTASC), read more here:

  12. TextMate is great but for advanced AS there really is nothing better than eclipse with FDT from Powerflasher. A bit complicatd to set up when you’ve got it you won’t regret it.

  13. “TextMate remains exclusive for the Mac, and that is how we like it!”

    Way to lose a huge market…

    Not to say there isn’t a bit of mactionalism in the sentiment, but I believe there are actually also deep, ingrained code issues for porting TextMate to Windows, mostly that it’s so unix-centric that more than half of it’s features would be significantly different implementations, and might not even make sense in the Windows/.Net framework.

    Also, for those interested in TextMate and Ruby on Rails, there’s a great video tutorial site called peepcode (plug plug), who have a good introduction video to the power of textmate (for RoR).

    If you know something about RoR, it would probably be worth the $9 charge for the video. If you don’t know anything about Rails and want to, peepcode has a good library of screen cast movies about it, which I’d recommend heartily.

    (note: I have no affiliation with Peepcode or TextMate other than being a happy subscriber and owner of their products)

  14. No offense, but you “just found” the most versatile text editor in existence? That sounds like a fairly absurd statement. Unless you made sure to check every text editor in existence.

    I check this site nearly daily and I really enjoy the tutorials, but there’s been a couple of these kinds of posts lately (Learning AS3.0 ” The Best ActionScript Book Ever Written”??) where you’re pimping a particular product making claims like it was your Grandma’s apple pie. Maybe it’s just how you talk, but it seems a little strange to me.

  15. Hey Lee.

    I switched to Mac a few weeks ago and I was searching for a editor to replcae my fav in XP, FlashDevelop, after a few days of searching, I ended up with TextMate, which looks very promiseing. I using it the “hard way” with out any bundles.
    Looking forward to your tutorial on how to use it more effectively…

    Btw.. I´m loving my MacBook Pro… I´ll never switch back to PC…


  16. @jjj I have tried every major text editor and I know of no other that is as easy to modify to your own liking. The built in editor for creating commands and snippets is the most versatile that I have used. And as for the ActionScript book, I believe it is the best one ever written to this date. These are my personal opinions. If you don’t like reading them then just lose my URL.

  17. I thought you were going to work on making flex and flash play better together :'(

    I might consider using TextMate for AS2 Development. I currently use XCode 2.5 with the language definitions for now. It would be cool if I could just flip a switch and have flex be in AS2 mode (pipe dream, i know). Actually, a better solution would be for those Clients stuck on flash 8 to let me publish flash 9 :P

  18. Hi,

    hehe, interesting post and I must say this text/code editor really looks great, but there is just one thing, it is not free. Then if I see that this text editor is not free I start to wonder why not buy Flex if I have to buy something, it probably costs more but it is Adobe product …

    Maybe you should explain to me why is TextMate better than Flex Builder.
    I see TextMate as competitor software to Flex. If you do not agree I would really like to hear your opinion.

    Must say I really respect your opinion, I love watching your video tutorials and I liked your AIR presentation in Geneva ;-), so please do not consider my post as hostile.

  19. Hey, Lee, nice tip. But you just overrode a nice built-in command by assigning it to Command-Return. By default, the “Source” bundle (which is active in pretty much every type of document that you are editing, as is the “Text” bundle…be sure to check both out) assigns Command-Return to “Jump to the end of the line, then press return.” In other words, with your caret in the middle of line, start a new line below without breaking the current line. There are other handy variations: Command-Option-Return places a terminator at the end of the line (a semi-colon in ActionScript) if it needs one, and Command-Shift-Return jumps to the end of the line, places a terminator if needed, and then starts a new line.

    All pretty handy, and I sure understand the rationale behind the choice of key stroke, but I’d recommend Command-R, instead, as the typical key stroke reserved in TextMate bundles for “Run.” It’s a hold over from Xcode, but virtually every other bundle uses it. And that way you don’t obscure other useful, built-in commands. In fact, this is the command that works with the built-in ActionScript bundle.

    I’ve tried all of the (Mac) editors, too. TextMate is the only one for me. Those complaining about TextMate’s Mac-only deal might want to check out Sepy, at least for ActionScript development. If you want something more versatile on the PC, then “E-TextEditor” is supposed to be “TextMate for Windows.”

  20. Again, I really don’t mean any offense, but you saying, “I know of no other,” is not the same as the definitive statement that it is the most versatile in existence. You’ve tried “every major text editor” (that you know of/in your language).

    If you said, “The most versatile text editor I’ve come across…” it would be a different matter. In your response to me, you clarify that it’s your opinion. Perfect. If it was written that way from the beginning you wouldn’t have to clarify it. You’re a trusted source. Whether they should or not, people come here expecting to get the inside word from “Adobe”. That’s all I’m saying.

    I won’t lose your URL, I enjoy news, insight and tutorials too much.

  21. I think intellisense (coding hinting) is completely underrated.

    Code hinting is to an object oriented reusable methodology as snippets are to a canabalizable/copy-able paradigm.

    It isn’t about forgetting functions and methods, it is about avoiding errors and facilitating inheritance and reuse.

  22. @jjj You said “Whether they should or not, people come here expecting to get the inside word from Adobe.” That is a mistake. People should come here to get my opinions, not Adobe’s. If I were to do that then I would simply say “buy Flash and Flex” instead of giving my honest opinion. That wouldn’t be good for anyone.

    @Dru Ahh I did not know that! I’ll have to remap that baby. Thanks for letting me know.

  23. I love textmate. I use it exclusively for all web development on my Mac. And i agree with you, i have tried what seems like everything and TM is simply the best.

  24. Any of you guys got a good AS3 theme for textmate? I’ve been looking on the wiki, but wasn’t that impressed with any of them really

  25. I’m going to be the grumpy dissenter here.

    I try and try to like Textmate (It’s miles above most OS X editors, its project handling is a dream, and it truly is a great step in the right direction), but the huge love it gets from the community just seems to be a symptom of the tremendous lack of other options available: Yes, it IS a great editor, but no, it is in no way an acceptable replacement for FlashDevelop or other editors available on other platforms.

    Maybe the long-awaited TextMate 2 will address the issues, but until then…

    There is no real completion, the code browser is an external plugin that cannot be docked (it might as well be a separate program), and frankly, it feels like the editors I left behind three years ago on other platforms. It’s more powerful than BBEdit (big f*’in deal), and easier to use than Vim, and it’s expandable. However, its architecture doesn’t allow it to be expanded in the ways that matter most to me: I can’t dock palettes, add real-time completion, etc.

    For now, I’ll take the free, old-in-the-tooth, but infinitely expandable jEdit or the young, up-and-coming, OpenKomodo editor while I wait patiently for TextMate 2. To date, there’s nothing in Textmate that isn’t also available in jEdit. Sure hope that changes, though, as jEdit is not exactly what I’d call “zippy.”

  26. I’ve been using Textmate for all my coding including, mostly AS3 for over a year now. I have to agree it is the most polished and versatile text editor out there for OSX — right now anyway. I want to like Flex, but it just feels kludgy and bloated. I do miss the code completion FlashDevelop provides. Hope that makes it’s way into Textmate 2+ in some form. It’s not horrible living without though, all the built-in keywords and any word on in the document regardless of language you are using complete by tapping ESC. I use that constantly.

  27. Hi!

    I’m using TextMate also but there is one problem witch I just can’t get around.
    Sometimes it seems as is flash cached the codes i edited in textmate. I add a simple trace somewhere and it just do not compile. I have to restart flash, to be able to see the changes…
    Is there anybody out there with the same problem? Or with any idea to solve this?

  28. Whenever I run this command, Flash opens, but then crashes. Could you please briefly explain each of these commands so I can troubleshoot. The script I cam running…

    echo “document.testMovie();” > /tmp/fc.jsfl
    open /tmp/fc.jsfl -a “/Applications/Adobe Flash CS3/Adobe Flash”

    Are there variables I should consider?

  29. @Alan

    Flash will crash with this script if it is not already open with a file to compile. Open Flash and open an .fla that you are associating with your code in textmate then hit cmd+enter and it will work for you.

  30. “I love FlashDevelop for this very reason. If you have a FLA open in Flash and an .AS file open in FlashDevelop and you hit [CTRL]+[ENTER] it launches the FLA (which obviously includes testing the code you are working on.) ”

    Textmate has done this forever

  31. thanks a lot for this great tip. now i made a little how to with mor edetails for those people that are new to textmate:

    How to use TextMate and Flash CS3 for building ActionScript 3 projects

    Note: You need to have a working installation of Flash CS3 and TextMate.

    1. Download flashcommand and unpack it.

    2. Move the flashcommand file to /urs/bin. You may need to identify as admin to install it.

    3. Checkout the ActionScript 3 bundle from the TextMate SVN to /Library/Application Support/Textmate/Bundles (create the directories if they don’t exist): 3.tmbundle

    Note: If you don’t have an SVN client try Versions (

    5. Open TextMate and go to Bundles -> Bundle Editor -> Show Bundle Editor and select the ActionScript 3 bundle.

    6. Click the Add-Button at the bottom and choose New Command. name the command Test Movie. Use the following settings:

    Save: All Files in Project
    # requires flashcommand in /usr/bin. download it at:
    # assumes the .fla file is already open

    echo “flash.getDocumentDOM().testMovie()” > /tmp/test.jsfl;
    open /tmp/test.jsfl;

    Input: None
    Output: Discard

    Activation: Key Equivalent and type Commmand + Return
    Scope Selector: source.actionscript.3

    7. To test your movie you have to open the fla in Flash and hit Command + Return in TextMate. That’s it!

  32. Ok, now I am using e-TextEditor (Windows Vista) and I’m really frustrated. Code completion and snippets works just fine, but I don’t know how to set it up to build projects or classes to swf files… Any ideas??

  33. Ok I’ve got a MacBook now and I have purchased TextMate but I am facing a problem as in I cannot target my flash projects to CS4 or playerglobal.swc. I really need to know how should I deal with this.

    I would be very grateful if someone could guide me.


  34. nuts!
    i tried everything. i installed the as bundle and made also an cmd+enter-command.
    but its not working nor cmd+R nor cmd+enter :-/

  35. i made it!
    here is the updated version:

    echo ‘document.testMovie();’ > /tmp/fc.jsfl
    open /tmp/fc.jsfl -a /Applications/Adobe\ Flash\ CS3/Adobe\ Flash\

    and if you’re using newer flash, swith all 3s to 4s.
    for testing purposes, switch input to ‘selected text’ and output to ‘replace selected text’

  36. Using OSX 10.4 and TextMate 1.5.9 I got the following to work:

    echo ‘document.testMovie();’ > /tmp/fc.jsfl
    open -a /Applications/Adobe\ Flash\ CS3/Adobe\ Flash\ /tmp/fc.jsfl

    The modification was in the ordering of arguments passed to the open command. I think that may be due to using OSX 10.4

  37. I might be the last guy to the party, but when I use the bundles mentioned here and textmate, when I tell the file to run, I get “Error. No file found to run.” I assume its because I’ve not defined the file that the actionscript must be built with. How do I do this?

  38. CS5 ver. :P

    echo ‘document.testMovie();’ > /tmp/fc.jsfl
    open -a /Applications/Adobe\ Flash\ CS5/Adobe\ Flash\ /tmp/fc.jsfl

  39. Hi all, I’ve recently downloaded Textmate and installed the AS3 bundle by Simon Gregory. I know code hinting / autocomplete is supported but i realized that I have to actually press option + esc for the dropdown menu to pop? This is unlike FlashDevelop or FlexBuilder where code hinting menus pop as I type. Is it supposed to be like this? Am I configuring it wrongly?