TextMate ActionScript 3 and Flex Bundles

Oct 30, 2007

As a Flash developer who’s been working with Flex and ActionScript 3 since late last year I found I couldn’t settle down and use the Flex Builder Eclipse plug-in. Previously I had acquired the habit of editing ActionScript using TextMate and compiled using the lightning fast MTASC, and although there were alternatives (FDT, Sepy), I’ve always preferred the lightweight flexibility and crisp feel that TextMate has. 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

Comments:

Chad - Nov 2, 2007

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?


Christoph ‘freelanders’ Landers - Nov 3, 2007

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/]


nemoDreamer - Mar 3, 2008

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 :)


William - Jan 3, 2008

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


William - Jan 3, 2008

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?


danilo - Jan 2, 2008

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!


Simon - Dec 1, 2007

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;


Travholt - Jan 6, 2008

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


Marcin - Nov 3, 2007

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


simon - Nov 4, 2007

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 !


Niko - Dec 6, 2007

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. ;)


Simon - Jan 6, 2008

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.


Simon - Dec 0, 2007

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!


Folletto Malefico - Dec 6, 2007

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. :)


Joachim - Nov 2, 2007

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


Andrea Passaglia - Mar 4, 2008

Your work is very appreciated.


Simon - Jan 3, 2008

Travholt: This should solve the problem. Specifically: 5.7.2 Setting LC_CTYPE


The Flash Art of War » Blog Archive » Flex SDK & Textmate - Mar 3, 2008

[…] 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 […]


alinear - Mar 1, 2008

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…


Simon - Mar 1, 2008

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.


Travholt - Jan 2, 2008

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.


jeff - Nov 3, 2007

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.


steve - Mar 4, 2008

FlashDevelop > TextMate


The Flash Art of War » Blog Archive » 1st NYC Flash Meetup - Mar 4, 2008

[…] 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 […]


Thomas - May 2, 2008

Hey Simon, first of all thanks for your great bundle! I just wanted to let you know that I integrated an fcsh server in your bundle… It opens a new textmate window with the fcsh running. I then compile each class on saving, and get any build errors instantly (with links and error message, formated via ruby) in the fcsh window. I managed to do this via a pipe, its still ruff around the edges but works fine for me. If your interested in integrating it, do not bother to contact me via mail, and i’ll send you the modified bundle.


dezza’s blog » Blog Archive » Actionscript editor choices - May 0, 2008

[…] with ANT build scripts for fast and easy multi-swf builds (see Simon Gregory’s blog for the AS3 bundle and the ANT […]


United States Of Martin » Blog Archive » TextMate + QuickSilver = Drag & Drop ActionScript imports. - Jun 3, 2008

[…] I wanted a better way to import classes from my class library. The TextMate ActionScript 3 Bundle Simon Gregory offers a nice auto complete functionality that lets you define a list of classes to choose from on […]


David - Jun 3, 2008

Thanks so much for the bundle! This may be nit-picky, but I recently updated the bundle and found there are situations where, in for loops, I might have “i<=styleNames.length” as opposed to “i <= styleNames.length” (that is, one has spaces around “<=” and the other does not). This used to be parsed just fine by the syntax highlighter but now it seems it breaks it, so it and everything after it are not properly highlighted. I like to leave my spaces off sometimes.


Scott Whittaker - Jul 0, 2008

Hi, I’ve been trying to get an ANT script working using fcsh_terminal (which I copied from the bundle into /usr/local) and I’m partially stuck. Running the normal “build (fcsh)” bundle command, I get the following Terminal output: (fcsh) mxmlc -o=/path/to/out.swf -file-specs=/path/to/Main.as fcsh: Assigned 1 as the compile target id Loading configuration file /Developer/SDKs/Flex3/frameworks/flex-config.xml /path/to/out.swf (619 bytes) (fcsh) but when run from ANT with the following exec command: I get the following result in Terminal: (fcsh) mxmlc fcsh: Assigned 1 as the compile target id Adobe Flex Compiler (mxmlc) Version 3.0.0 build 477 Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved. mxmlc [options] [defaultVar] Use ‘mxmlc -help’ for more information. So it looks like it gets the first path to mxmlc in the Flex SDK, but fails to get the rest of the arguments. I have tried using a single long arg line instead of multiple ones, and I’ve tried enclosing all paths in an extra set of quotes, but it’s not working. Any ideas?


Scott Whittaker - Jul 0, 2008

Of course my ANT tags got stripped. The exec command looks like this: [exec executable="fsch_terminal” failonerror="true”] [arg line="path/to/fcsh mxmlc” /] [arg line=”-o=/path/to/out.swf” /] [arg line=”-file-specs=/path/to/Main.as” /] [/exec] And I also tried: [exec executable="fsch_terminal” failonerror="true”] [arg line="path/to/fcsh mxmlc -o=/path/to/out.swf -file-specs=/path/to/Main.as” /] [/exec] Thanks, Scott


Daniel Lopes - Jul 3, 2008

Thanks for this.


MIchael Narciso - Aug 5, 2008

Simon, for some reason I can’t get syntax coloring to work with this bundle. Please assist?


Simon - Aug 3, 2008

@ MIchael I’m assuming that syntax coloring isn’t working because you have not associated your document with the language. This should happen automatically when you create a file with the file types .as or .mxml. However in the case of .as files you may find that TextMate associates the file with the default ActionScript (2) bundle. To manually change the language association select ActionScript 3 from the language pop-up in the document status bar (at the bottom).


Marcos Zanona - Dec 5, 2008

Hello Simon, just a curiosity What’s exactly is the objective of the lib folder generated with the AS3 Project wih your bundle in textmate? How can I use it? Thanks


TextMate + QuickSilver = Drag & Drop ActionScript imports. | The Markovian Parallax Denigrate - Dec 5, 2008

[…] I wanted a better way to import classes from my class library. The TextMate ActionScript 3 Bundle Simon Gregory offers a nice auto complete functionality that lets you define a list of classes to choose from on […]


Rich - Apr 3, 2008

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


Simon - May 4, 2008

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.


The Flash Art of War » Blog Archive » flashlog.txt for trace(); - May 6, 2008

[…] 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 […]


Martin - Sep 2, 2008

I absolutely love this bundle, but I find the ActionScript Project Template to be an exhaustive overkill for my needs. I’ve tried cutting it down a bit in terms of files and folders created, but I keep messing it up so it won’t create the project. What’s the chance of a bare bones version of the AS3 Project template that includes only a src, bin and deploy folder and the bare essentials to be able to compile the swf? Alternatively a few pointers on where to gut the current template to suit my needs… My shell-fu is weak.


neo_21670 - Sep 3, 2008

hi there, i recently started using your Flex bundle, and i’ve noticed some sort of bug. Upon creating a new mx:Style tag, and pressing enter to separate the tags, Textmate gets into a loop consuming all the CPU and of course locking up the editor. Is there any workaround for this?


Simon - Sep 5, 2008

@neo_21670 Thanks for spotting that, it’s a pretty serious issue and it wasn’t limited to the Style tag the same was happening to the Script and Metadata tags as well. I think that it was down to using look ahead / behind regex matches to delimit an included language grammar. I’ve made some changes to the Flex language grammar so if you grab an updated version of the bundle from the TextMate repository the problem should now be fixed.


Simon - Apr 0, 2009

@Steven - I double checked and somehow, in the version I checked in, I’d not got the regex properly escaped. This is fixed with r11480 - thanks for letting me know it wasn’t working.


paul - May 5, 2009

hello all loving textmate! thanks a lot….but i don’t know how to import custom classes without physically adding them into my actionscript project. i’ve tried adding a path by using TM_AS3_LIB_PATH in preferences » shell variables & i’ve played around the project & flex config.xml files - all to no avail. any help would be greatly appreciated! paul


Marcos Zanona - Aug 6, 2008

Hello there, Simon, do you know why if I use the custom set of index.html and swfobject inside your bundle, everytime I create a new project and after publish it, when I run (command+r), the index.html says me that I need flash player 9+, if I already have it…I have adobe flash cs3 installed on my mac and everything goes fines. but when try to run with your set of files I got this error. And when I try to public with flash player instead of index.html textmate says that cannot find de SAFlashPlayer application Can you help me on this please? Thanks


Steven - Apr 6, 2009

Hey Simon, Great bundle, but like David, I can’t get syntax highlighting working on include files. I’ve tried grabbing the latest svn version, and adding //AS3_INCLUDE_FILE, but to no avail. Any other ideas?


Simon - Oct 5, 2008

@ Ronnie I’m not sure why you’re getting the error with $TM_FLEX_FILE_SPECS, I’ have had another report that it fails so I have re-tested the bash code but can’t find a condition in which it fails for me. Are there any odd characters in the directory path? I did try it with spaces (which trips up fcsh) but that didn’t throw it off. @Ali There’s two things you can do, add the super() calls in your constructors if you have access to the code - generally I try and do this. Othewise you can modify the compiler settings, in the config file use: <compiler> <warn-no-constructor>false</warn-no-constructor> </compiler>


Detrus - Mar 5, 2009

I can’t use Leopard on an older machine, but would like to use fcsh. Seems like you removed support for fcsh through iTerm. I wonder if it would work if I used the oldest downloadable version of iTerm and the old bundle scripts that supported it. Can you make those old iTerm supporting bundle files available?


Simon - Aug 0, 2008

@Marcos I’ve just run through creating a new project, compiling and running it and didn’t see any problems. I tested with the latest versions of the bundles (from the TM repository) in Safari, and when visiting http://www.macromedia.com/software/flash/about/ it reports i’m using the 9,0,124,0 player. Can you check what version you get when you visit? Also, the SAFlashPlayer could be solved if you use the simpler open "$TM_FLEX_OUTPUT" line in the run command.


TextMate Auto-Import AS3 « Bodega Bodega - May 5, 2009

[…] you use TextMate? Do you use the ActionScript 3 bundle by Simon Gregory and co? If you do, you might be interested in … wait for it … my first […]


Alan - Aug 1, 2008

Hey Y’all. I’ve had it with Eclipse / Flex Builder - and want to get involved and contribute to using textmate + Flex. But For the life of me, I cant figure out how to do a simple compile of the Flex app. Is there a FAQ or walkthrough I’m missing. I’ve read some posts about using iTerm, but read others claiming it wasn’t nessesary. IS there a Flex compiler - or am I supposed to compile it as though it was an AS3 project. Last - where do I put the SDK files….Should I be looking on the web for setting up AS3 projects and jsut apply it to the Flex bundle, or are there any other ‘catches’. Alan


Alan - Aug 1, 2008

Whoops, Ok I made an assumption, When I saw “ActionScript” in bundles, i assumed it was “AS3”….So now Im looking at ‘how to instal Flex sdk….” duh….Sheesh


SimonL - Jul 6, 2009

Subject: Can’t build with new install on Leopord Just moved to new computer and am installing on OS Leopard I have installed the latest Textmate and the May 2009 build of the bundle. And latest Flex 3 builder with sdks. I cannot Command B build and get a fcsh path not found error. The path to the Flex Builder 3 install is identical with the value in the search path as reported in the error (/Applications/Adobe\ Flex\ Builder\ 3/sdks/2.0.1/bin). When i looked in the 2.0.1 SDK’s bin there is no fcsh. This confused me as there is a fcsh in the bin of v3 of the SDK. So I copied it to v 2.0.1’s bin and still get the same error. I have checked the path to the bin in the terminal. Then I remembered that I always used the ‘build using… mxmlc’ command on my old computer as I didn’t have iTerm. But this command and the build class command are not available in the menu and not listed in the bundle editor. I’m not sure why fsch is not found and also why the install looks different with these commands missing. To get either working would be great if you can help please?


Ali - Oct 4, 2008

Hey Simon, is there a way I can prevent the compiler warning: Warning: The super() statement will be executed prior to entering this constructor. Add a call to super() within the constructor if you want to explicitly control when it is executed. Cheers :) Ali


Webalab - Jul 1, 2009

I was used to compile with the mxmlc thing although, this fcsh seems to be faster… Anyway, i just want to point something out, if you add any external folder to the project, the build command wont work. Right now im not entirely sure if im doing something weird or its a bug, but if i add any external folder to the project, cmd+b will throw a " Missing Settings: The environment variable TM_FLEX_FILE_SPECS does not resolve to an actual file.” Cheers


Simon - Mar 1, 2009

Here’s some long overdue responses: @lauritz 1. These features may be better suited for a Flash bundle. That’s with the exception of the formatting request, and I don’t have the time for the amount of work that would take at the moment. 2. If you grab the latest version of the bundle then this functionality is in an alpha state. @Du Song - I try and use the first line regex match. This is unreliable though, and it means adding AS3 somewhere in the first line of every ActionScript 3 document. @SimonL 1. In the bundle editor, select the project template and edit away. 2. You can change the settings in the compiler config file. You’d need to add false in the compiler node. 3. I had to drop support for iTerm and fcsh on Tiger I’m afraid. 4. What revision of the bundle are you using? 5. Type doc then press tab. 6. There aren’t any formatting tools available at the moment, once someone writes one that’s usable I’ll plumb it in. @Omar Fouad - On Windows? I’ve no idea, if you work it out maybe you could knock together a quick how-to for other eText-Editor users? @jens - sorry to hear you’ve had such a bad time debugging the build_with_fcsh.sh. As I’m solely running Leopard these days, and no longer use iTerm I decided to drop support for it. However looking at your change I imagine that you’d need to cover as many cases as possible when trying to detect iTerm for compatibility reasons. @Marcos Zanona - I use it for external code libraries and swcs. @Detrus - I removed the iTerm / fcsh support as I have no means to test that it works anymore and I’d had reports that it wasn’t reliable anyway. However if you need to then take a look at in the TextMate subversion repository before r11042 and you will find what you’re after. If you’re happy to keep this alive then you could fork the bundle on github. @Webalab - Try setting things up manually on the command line and then use --config-dump to generate a correctly formatted compiler config file.


Alan - Aug 2, 2008

Well, I’ve been scouring the web but can’t figure this guy out. In TM should I just be able to: File>New From Template>Flex>Project Save then: Bundles>Flex>Build I get this error: 21:22: syntax error: Expected expression, property or key form, etc. but found unknown token. (-2741) I have my sdk in Developer>SDKs>flex_sdk_3 What else should I be looking at?


Simon - Aug 3, 2008

@Alan I’ve just followed the steps you describe, but using: Bundles > ActionScript 3 > Build and didn’t get the error. As the error output is AppleScript I’m wondering what version of the OS you are using? And does Bundles > ActionScript 3 > Build Using… > Build (mxmlc) Work for you?


Lars - Nov 3, 2008

Hi. When I do a “List Class Members” and then select a member, I get errors like this: /tmp/temp_textmate.N8woBi:18:in `[]': can’t convert Hash into Integer (TypeError) from /tmp/temp_textmate.N8woBi:18 Any idea of what’s wrong? Thanks.


Better (AS3) import completion in TextMate | The Markovian Parallax Denigrate - Dec 1, 2008

[…] meat of this trick is the excellent work by the creator of the ActionScript 3 bundle for TextMate; Simon Gregory et […]


Du Song - Nov 3, 2008

How to auto detect opened .as file, tell as from as3?


Actionscript 3 and Flex Textmate Bundles | reallygoodmagazine.com - Nov 5, 2008

[…] This has been missing for a while.  I’ve been looking around and finally found some.  HERE THEY ARE […]


Ronnie - Sep 2, 2008

Hey, I downloaded the Actionscript3 Bundle, set up my flex sdk path and created an ActionScript 3 project. Tried running the compile (mxmlc) but it keeps complaining this: “The environment variable $TM_FLEX_FILE_SPECS does not resolve to an actual file. " The project info shows that that variable has already been set and everything else is default as per the bundle. Any ideas ?


Ronnie - Sep 2, 2008

I found out why it didn’t work and hope this helps anyone else in the future. I downloaded the opensource sdk and build it with the instructions found at http://opensource.adobe.com/wiki/display/flexsdk/Build+and+Test One of the instruction was to clean the ant build using “ant -q clean”. DO NOT RUN THAT. It removes the fcsh.jar files and some other files that is required for the bundle to compile with mxmlc or fcsh. Hope this helps.


Ronnie - Sep 2, 2008

Correction. The “ant -q clean” does what it was supposed to. It cleans up all the build output *duh* My bad. Thought it was only cleaning the test files. I resolved this by commenting off the check for the $TM_FLEX_FILE_SPECS in the “Build (mxmlc).tmCommand”. The variable is definitely there but the bash conditional kept failing. Commenting it off works.


Brian Yamabe - Oct 3, 2008

Simon, I needed an instance of the fcsh shell for each project I had opened so I enhanced build_with_fcsh.sh to call fcsh_terminal with an extra parameter (I added an extra project variable calld TM_FLEX_PROJECT, but you may have a better mechanism). That extra parameter is used in fcsh_terminal to augment the FCSHWindowTitle to make it unique for each project. It seems to work well and wanted to see if you wanted to incorporate it. FYI, I did this so I could do unit testing. I have one project with the test runner as the target class and one with the real target class. I didn’t like running one with fcsh and the other with mxmlc.


lauritz - Nov 0, 2008

thanks for your work! please let me add some wiches to your future bundle development: 1. please add a better flash ide (cs3/cs4) support. this includes: - add “build and run” command that opens flash ide and tests the movie in the flash ide (just like the old actionscript 2 bundle). - add a command “documentation for selected word” to look up words in the doc files that come with the flash installation. - add a code “tidy up code” command that is cleaning up the code. this means remove unused empty lines, correct indention, add missing “;”, and throw out warnings when the syntax has errors. in fact the same functionality that has the “auto-format” button from the actionscript editor inside flash cs3. 2. the autocompletion is already very nice. but it would be even better when a little window pops up while typing, which dsiplays all possible completion words. maybe like coda? if you get this all in i would pay $50 at least for the bundle. or you could make a free bundle and one that costs, but that has more features. contact me, maybe our agency can support your development with money.


paul - May 3, 2009

for anyone who’s interested, i discovered that you add the path via the info button at the bottom of the project folder draw……


David - Apr 3, 2009

I’m trying to get a handle on using TextMate for my AS3 projects and am currently using it just to build out blocks of code that I’m then including in another file. I’m finding though that the syntax coloring doesn’t seem to like my code unless it’s in a package or class. Am I missing something here or is there some way to get this to work even for my classless code? I find that when I switch the doc type over to Actionscript (and not Actionscript 3) the color coding seems to work fine. But this makes me a bit nervous…


TextMateカスタマイズ・ノート | イナヅマtvログ - Dec 2, 2008

[…] Actionscript 3 Bundle でActionscript 3へ対応できる。 […]


Alan - Sep 2, 2008

OMG!! It worked!! I donno how or why, but I just started a new project and went right to build and the .swf got published. THANK GAWD ECLIPSE DRIVES ME CRAZY. I feel like a kid at christmas!!! This is awesome! I can’t wait to start playing with this bundle! Ok a quick question if you don’t mind… I can do all this stuff: http://www.onflex.org/ted/2006/04/custom-flex-2-builder-compiler-options.php in the “( my project name )-config.xml” right? How about when I manipulate and add a “services-config.xml”? Do I pop that in here too? See, this is what I don’t like about all that code hinting in Eclipse / Flex Builder. So much is done for me, that I don’t really learn what is going on. Well thanks again for your work. I hope I can contribute to this bundle. Alan


Alan - Sep 2, 2008

and adding a SWC, how does that look in the: “( my project name )-config.xml” file. Thanks


Simon - Sep 2, 2008

@ Alan I’ve not used one personally but I think that you need to specify the location of your services file in the compiler config.xml file. Ie path/to/services-config.xml For your swc try: ../lib/bin/


Simon - Sep 2, 2008

@Martin Glad you like the bundle :) I should be able to add a skip button to the package dialog which would end up giving you a bare-bones project - I’ll add it to my TODO list. In the meantime you should be able to easily stop a file being created by commenting out all the lines that it is referenced in. Should be a simple case of adding a #.


JOsH Lindsay - Oct 6, 2009

Rock on, I agree, Flash Develop, Flex Builder/eclipse SDK, seems to be to heavy for the most part. Although, I as much as I like textmate there are still much to be desired from it.


milos - Sep 1, 2008

Thanks Simon for such a great bundle! A question: After editing the build.xml and compile.sh files for custom builds (I’ve merely changed the deployment directory spec), the bundle no longer generates the supporting html and js files, nor the _assets directory. Do I need to specify this in the build.xml file or am I missing something… Many thanks! Also thanks to nemoDreamer for his post on changing the permissions on the compile.sh!


Simon - Nov 0, 2008

@ Lars Thanks for thebug spot. I’ve been working on the full autocompletion functionality so haven’t used the “List Class Members” command myself for a while… a fix has been committed to the repository. Or, the offending line (18) needs changing to: out += i['data'] if i != nil


David - Sep 0, 2009

Hi Thanks so much for the AS3 Bundle. I’m currently having problems with the reliability of linking to the Documentation (docs). I’ve followed your instruction meticulously: My docs folder is as advised, in the Flex SDK directory. It occassionally works and then occassionally tells me that: Search failed for “NetConnection” (or whichever class name). I do not have the Flash authoring application installed as I’m trying to use only TextMate with the Flex SDK. The instructions below the above message then seem different to those provided in the TextMate As3 Bundle ‘docs’ help where by it states a path that wuld suggest I have Flash installed. The advise for setting the search path manually may also be referencing something that’s installed with Flash as a search for ‘help_toc.xml’ returns nothing :-( I hope this is the most relevant area of your site to post this thread. If not I apologise. A reply with regards to correctly CTRL-H linking to the docs would be really helpful. Many thanks in advance David


Edu - Sep 3, 2009

Hi Simon, I feel ashamed to get to know this bundle that late (blush). Anyway, I have a feature request (hope I am up to date since I download manually, not through svn): * Would be possible to add a new env_variable such as TM_FLEX_COMPILER_PARAMS where to add extra mxmlc parameters such as adding SWC libraries or require flash player 10 for example? * Would also be possible to add another env_variable where to specify the standalone player to use (not default) in case we need to use a specific debug player? Many thanks in advance! Cheers!


Andy - Sep 2, 2008

Hi simon, nice bundle altough i’m experimenting now with the fp10 flex sdk and it’s stored in my User directory, how can i easily change wich sdk textmate has to use, to compile my project? greetings Andy


TextMate+AS3@Mac « szkid - Apr 4, 2009

[…] Simon Gregory:TextMate ActionScript 3 and Flex Bundles を「Applications/TestMate.app/SharedSupport/Bundles」 […]


Auto-Complete Imports from SWCs in TextMate | blog.jeremyruppel.com - May 6, 2010

[…] a huge fan of TextMate and because of Simon Gregory’s awesome ActionScript 3 Bundle, TextMate can do nearly everything I could ask for while still feeling light and context-friendly […]


配置TextMate的ActionScript3开发环境 - Mar 1, 2009

[…] TextMate自带一个简单的ActionScript bundle,但功能实在有限,所以Simon Gregory等人就又写了ActionScript3和Flex两个bundle。建议用svn方式checkout最新的bundle,这样可以保证用上最新的功能。具体做法如下: […]


Simon - Apr 5, 2009

@David - Limitations in the TextMate grammar scheme (specifically that it only matches one line at a time) mean I don’t see an effortless way of getting include files to syntax highlight properly. It did occour to me that I could introduce an artificial ‘scope’ to get it working, so if you put this //AS3_INCLUDE_FILE comment at the top of your files, and make sure you’re using at least r11458 of the bundle then you should start to see things work.


Webalab - Mar 4, 2009

Hey, amazing job. although, there’s just 1 little thing keeping me from removing flex builder. when i try to add( to project-config.xml ) path/to/services-config.xml or ../lib/bin/ it doesn’t work, its not showing any warnings or errors, and it looks like it build the swf with no problems. but no swf is created. i believe some how the compiler is bailing before doing the hardcore stuff. i tried like 200 different ways and no success. am i missing something? thanks for the help, and once again, great work!


TextMate AS3 | [mck] - Apr 3, 2009

[…] reading here: textmate actionscript 3 and flex bundles, it’s about the files you will use. But besides being informative, I needed more help. I […]


SimonL - Nov 6, 2008

I really enjoy using Textmate with this AS3 bundle. I have more questions than answers. I hope they are simple. 1. I’d also like to streamline my projects. Where do I edit this, please? 2. I’d like to change the way that the compiler deals with errors. (It made me add ‘super()’ to the whole of caurina’s transitions code which just can’t be right. Where do I do this? 3. I’d like to use fcsh but even when I install iTerm it wouldn’t work. Can I make it work through the OS X terminal? Why do i need iTerm, anyway - is the built-in term not adequate? 4. Command B will not respond. I’m not sure why but I have to select from the menu. (Command-Shift B works but that’s one extra key stroke to compile 5. How do i comment blocks of code? 6. Formatting goes easily awry. Reformatting with ^J or ^Q is disastous. Is there a way that i can reformat AS3 nicely? I use OS Tiger and have no idea which version of the bundle I use - I installed it in the summer. Textmate is now 1.5.7. Flex SDK 3. Many thanks for the Bundle!


Joseph Magnani - Oct 3, 2008

Hi Simon, Thanks for making this bundle so awesome. I have just one request. I have fcsh setup and working now, but am looking for a way to put together a “build and run” command. Right now you have to manually watch the terminal and wait for fcsh to complete before you attempt to reload the browser. Doing this many times all day is tiring. Would be nice to hit one command and have it compile and run in one swoop as the flex ide does. There must be a way to tail the output of fcsh and wait for a success. Cheers, Joseph


Simon - Sep 5, 2008

@milos I’m guessing you’re used to Flex Builder so you need to know the AS3 Bundle is designed to simply generate the swf each time, and not the associated “deployable” files. Flex Builder (I’m rusty on this) will take any files it finds in the declared template directory and copies them to the bin directory when you build (if they’ve changed, are missing). It also offers a “clean” command which will delete the bin and copy all files in freshly. If you want the same behavior I’d recommend that you look at building some custom ant tasks, or shell scripts which compile then copy the necessary files - rsync can be very handy here. @Andy You need to set the environmental variable TM_FLEX_PATH - see ‘Environment Variables’ (Chapter 9) in the TextMate manual for instructions on how to set these. Personally I store all the SDK’s in /Developer/SDKs/ and generally chose to control which one is used using project dependent vars.


Rich - Sep 5, 2008

I’m on Tiger and was getting the “must have iTerm installed” error when trying to build. In build_with_fcsh.sh I changed iTerm to iTerm.app on line 26 and it works.


Control Option Command » Better (AS3) imports in TextMate - Apr 5, 2009

[…] meat of this trick is the excellent work by the creator of the ActionScript 3 bundle for TextMate; Simon Gregory et […]


Simon - Apr 3, 2009

@David - To get this to work you’d need to edit the ActionScript 3 Language Definition and add a specific scope for include files. At the moment it’s deliberate that it doesn’t work, but it shouldn’t be as having code loose is entirely valid. Editing the language definition isn’t the easiest thing in the world to do - so I’ll add it to my todo list. If you try please let me know if you have any success.


jens - Dec 2, 2008

hi, just noticed and wasted hours to find a small bug in your build_with_fcsh.sh script. i tried to find the reason, why the message kept popping up, that iTerm is not installed, also it could be found, by another bundle-script. so i found this: [code] #Only check for iTerm when the OS is Tiger. if [[ “$OS” == 10.4.* ]]; then # this does not work .app is missing # if find_app >/dev/null iTerm; then ## identifier is also net.sourceforge.iTerm if find_app >/dev/null iTerm.app; then #All is ok. do_nothing_variable="TODO remove this by checking the negative” else echo “This command requires iTerm to be installed.” echo “See bundle help for more information.” exit 206; fi fi [/code] now it works :)


jens - Mar 2, 2009

thanks for this great bundle! and thanks jens for pointing out that little bug!


Omar Fouad - Dec 1, 2008

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??


SimonL - Apr 1, 2009

Many thanks for your reply. > 1. In the bundle editor, select the project template and edit away. I commented out a few mkdir’s as a test and then the bundle would no longer make a new Project. Last time I tried this I had to re-install the bundle. > 4. What revision of the bundle are you using? I’m not clear where to find the version no. but I had a copy from Jan 2009 and just installed the latest. I still cannot Apple-B to build. >5. Type doc then press tab. thanks >6. There aren’t any formatting tools available at the moment, once someone writes one that’s usable I’ll plumb it in. Well, formatting is a lot easier now and I have to re-iterate that this bundle is brilliant and being able to use TextMate has transformed my AS programming experience. thanks.


SimonL - Apr 2, 2009

> 1. In the bundle editor, select the project template and edit away. I find that if I edit the project template - ie. comment out a few of the extra mkdirs then I cannot create a new project. Uncommenting the commented mkdirs didn’t help get back to normal. Reinstalling the bundle fixed that but… Then I find cannot compile a project. The only way I found to fix this was to delete the bundles , delete Textmate and start over. I think this is what happened last time I tried to edit the project template.


Ryan - Feb 3, 2010

A heads up…the reason the newest Textmate update broke the Import Class command was because the Textmate.each_text_file implementation changed. In order to get it working again (and to avoid altering the textmate.rb file) I added the following function do source_tools.rb

def self.each_text_file (&block) project_dir = ENV[‘TM_PROJECT_DIRECTORY’] current_file = ENV[‘TM_FILEPATH’]

 if project_dir then
   TextMate.scan_dir(project_dir, block, TextMate::ProjectFileFilter.new)
 elsif current_file then
   block.call(current_file)
 end 

end

I then changed line 40 from TextMate.each_text_file do |file| to each_text_file do |file|

That should do the trick for anyone that is having issues with the latest cutting edge release.


Ryan - Feb 3, 2010

The code above striped my underscores. It should read

each_text_file


Ryan - Feb 3, 2010

each[underscore]text[underscore]file


John del Rosario - Jun 4, 2010

Where can I find the help of this bundle? I’m having trouble setting up the Flex SDK, and creating a new file using the templates of this bundle does not do anything (no file is created).


SimonL - Jul 6, 2009

I will answer my own message (see above) in case anyone else has these troubles. First – I now understand this is a brand new version of the bundle. My earlier one had the extra commands – which I assume are no longer needed. QUESTION. Where do we find standard documentation and version nos. for bundles (especially svn shy people like me) ? I also can see that this new version is cleaner in having one Cmd-B, one way of building. Second -with regards the fcsh path not found. I reinstalled fcsh from the installer on Adobe.com and then tested it from the terminal. It now worked. Then I went into the bundle’s build.rb and commented out these two lines: #FlexMate::SDK.add_flex_bin_to_path #TextMate.require_cmd “fcsh” Then I added the path to the sdk bin directly in the textmate prefs in TM_FLEX_PATH. After that back to normal. I don’t really understand what was wrong with the path and if there is a better way of fixing this I’d like to know. Also a question: Can i make the swf auto open in a Flash projector if I choose instead of the index.html launching? Any great work on the Bundle and I’m glad to have textmate/as3 back up on my new laptop.


ivan - Sep 5, 2009

hello all, I see a lot of people here talking about the autocompletion. Unfortunately I can’t see it working. I’m used to work on Xcode with definition files and a projet template that tells where the compiler is. That config rocks, the autocompletion works with actionscript built in function, plus the local variables and function names. Is it possible to achieve this with this plugins, and how ? Currently what I have is a TextEdit with colors and a Run button, it is a bit disappointing :(


SimonL - Jul 2, 2009

I have two more feedback items. 1. On two machines, both running Leopard, right-clicking on a project folder and choosing New File:AS3 Class from the contextual menu yields no file after having named it and choosing ‘create’. 2. Renaming the main project folder (a no brain way i have of version control) renders build inoperable. Note that this used to work in the earlier version. I’m enjoying using fcsh. Very fast.


colin - Mar 3, 2010

hey simon,I’m a coder from china, and my english is not so pretty.so …you know ^_^ first, this article is very good for me.^_^ Back to topic.I’m fresh for usering textmate to develop as3 app. So I want to download the latest version of as3 or flex bundle, could you give me the svn address or some other address format, thanks. secondly, I’m very eager to know how to configure this ide, so that I can start my as3 program. And I hava a presumptuous request, that is could you send me an email about the steps of the configure please.Thank you very very ……. much. thanks


colin - Mar 3, 2010

haha,my Email address: colin_liao@hotmail.com thanks a lot


colin - Mar 3, 2010

Hi Simon, me , again. haha. I’m feel very sorry to faze you. There is no need to read the questions I ask before. Because , I’v already fix them after I read the help. But I steal got a problem. When I press cmd + B to built the program, the bundle commands search the directories which contains sdk. Finally it shows the path is “~$ /Applications/Adobe\\ Flex\\ Builder\\ 3/sdks/3.0.0/bin/fcsh” but “-bash: /Applications/Adobe\: No such file or directory” I think that there’s an additional ‘\’ in the path. So how could I fix this? thanks. And wait your reply


Martin - Dec 3, 2009

My file is recognized as AS3, and I´m able to use the code complete provided by your bundle. But as Michael Narciso comments, the color syntax does not work. Switching to AS2 gives me a nice color syntax, but unfortunately I´m working with AS3. ;) Simon, would you be so kind and help me out here? :)


Thach Duong - Jan 2, 2010

can you improve the Flex Bundle . At this time, flex code completion can’t recognize an Custom MXML Component and xmlns.


Ryan - Dec 1, 2009

Hi Simon, Any idea of why the newest Textmate update broke the auto import of classes in the project? (apple + shift + i)


Auto-generate getter / setter of ActionScript 3 in TextMate « makzan / blog - Jan 0, 2010

[…] last, thanks nesium.com for the as2 version of accessors generation and thanks Simon Gregory for the actionscript 3 TextMate […]


TextMate Auto-Import AS3 - Feb 3, 2012

[…] you use TextMate? Do you use the ActionScript 3 bundle by Simon Gregory and co.? If you do, you might be interested in … wait for it … my […]


Flex tools for Mac « « Programmers Goodies Programmers Goodies - Jul 0, 2011

[…] + the Flex and ActionScript 3 bundles is a great combo. Throw in ProjectPlus and you have an almost full featured development […]


Simon Lucas - Feb 2, 2011

Trying to access symbol with linked classname in SWCs.

Hi. I have followed the SWC technique of placing it in the libs folder and then editing the appliaction config xml file with

../libs/

I have a single linked symbol myButton which I then try and use in main.as. The compiler does not see myButton as a class. It is not aware of it. How do we make the compiler link the swc’s classes?

As an aside, I love using the textmate/as3 bundle but I feel in general that I am missing the knowledge required to troubleshoot an issue like above. I’d like to understand the relationship between the bundle, it’s config files, app-config.xml, the build.xml, the various shell variables (and the various places they can be defined) and what gets passed to the fcsh/mxmlc compiler command. When running the build I cannot fully see what is happening and what shell vars and directives are in play. Is there some way to do that?

Regards S


TextMate Auto-Import AS3 | Neon Bodega - Aug 4, 2011

[…] you use TextMate? Do you use the ActionScript 3 bundle by Simon Gregory and co? If you do, you might be interested in … wait for it … my first […]


Josh - Jun 1, 2012

Hi Simon, great bundle thanks!

Just wondering if you know why I’m not getting any trace output in flashlog.txt from sfws compiled through the bundle?

I tried setting true in flex-config.xml but no biscuit.

I get trace logs appearing from other swfs as I browse the web so it’s not a problem with the tracing config. Cheers for any light you can shed!

Josh

OS X: 10.7.4 Flash Player: MAC 11,2,202,235 (Debug player)


drpelz - Jan 1, 2012

Hi,

when trying to activate the auto complete feature of the actionscript 3-bundle I always get this damn error message:

Users/User/Library/Application Support/TextMate/Pristine Copy/Bundles/ActionScript 3.tmbundle/Support/lib/fm/flex_mate.rb:56 warning: Insecure world writable dir /Users/User/Library/Application Support in Path, mode 040706

The auto-complete doesn’t work when trying to get the properties of a function or class.

Can anyone help, please?