TextMate JavaScript Flash Bundle

Jul 31, 2008

I’ve quickly put together a bundle for working with JSFL, or the Flash JavaScript API. If you’re not familiar with JSFL it is used to automate and extend the Flash IDE. The bundles language grammar relies on the JavaScript bundle being installed (which is one of TextMates default bundles) as it extends it and adds all of the JSFL objects, methods and properties. You also get:

Run (⌘R)

Runs the current document in Flash.

Documentation (⌃H)

Searches the documentation and presents a list of matches. As I only have access to machines with Flash CS3 installed I don’t know the alternative paths to the documentation previous (and later) versions of Flash use so please drop me a line and I’ll include them.

Auto Complete Method / Property (⌥⎋)

Provides a pop-up list of the available method and property completions based on the current word. I’d recommend checking out the bundle from here for the most up to date version, otherwise you can download it as a zip here.

JSFL Bundle


Comments

Travis - Aug 3, 2008

Hi, Thanks for the great bundle of actionscript 3. But I got a prob of the last svn version: —– var aaa:AAA=find: /.fseventsd: Permission denied find: /.Spotlight-V100: Permission denied find: /.Trashes: Permission denied find: /private/tmp/launchd-18.t98iTh: Permission denied find: /private/var/agentx: Permission denied find: /private/var/at/tabs: Permission denied find: /private/var/at/tmp: Permission denied find: /private/var/backups: Permission denied find: /private/var/db/dhcpclient: Permission denied find: /private/var/db/DirectoryService: Permission denied find: /private/var/db/krb5kdc: Permission denied find: /private/var/db/shadow: Permission denied find: /private/var/db/sudo: Permission denied find: /private/var/log/krb5kdc: Permission denied find: /private/var/root: Permission denied find: /private/var/run/mds: Permission denied find: /private/var/samba/winbindd_privileged: Permission denied find: /private/var/spool/cups: Permission denied find: /private/var/spool/fax: Permission denied find: /private/var/spool/mqueue: Permission denied find: /private/var/tmp/launchd: Permission denied find: /System/Library/User Template: Permission denied new AAA(); —— look, i var aaa then new+tab I got the list of “find” but it works “new AAA()” and prob 2: When “import+tab” I can only see the default list like “flash.events…..”, never my com.iLouYou….. or some other as3lib do I need add some shell vars to TM? and prob 3: when cmd+b it complies the as to swf, but I should open the swf myself, is there a auto-open setting? Thank you again! You did really great!


Travis - Aug 5, 2008

Thanks, Simon. To the point 2, I mean how can I add a source folder(like PV3D or as3Lib) to the project that TM can add the classes in the folder auto. And I use alt-esc after “import”, wow: /Volumes/iSoft/Program/TextMate.app/Contents/SharedSupport/Support/lib/textmate.rb:107:in /bin/bash: -c: line 0: unexpected EOF while looking for matching `’’ /bin/bash: -c: line 2: syntax error: unexpected end of fileentries’ from /Volumes/iSoft/Program/TextMate.app/Contents/SharedSupport/Support/lib/textmate.rb:107:in /bin/bash: -c: line 0: unexpected EOF while looking for matching `’’ /bin/bash: -c: line 2: syntax error: unexpected end of filescan_dir’ from /Volumes/iSoft/Program/TextMate.app/Contents/SharedSupport/Support/lib/textmate.rb:107:in /bin/bash: -c: line 0: unexpected EOF while looking for matching `’’ /bin/bash: -c: line 2: syntax error: unexpected end of filescan_dir’ from /Volumes/iSoft/Program/TextMate.app/Contents/SharedSupport/Support/lib/textmate.rb:112:in /bin/bash: -c: line 0: unexpected EOF while looking for matching `’’ /bin/bash: -c: line 2: syntax error: unexpected end of fileeach’ from /Volumes/iSoft/Program/TextMate.app/Contents/SharedSupport/Support/lib/textmate.rb:107:in /bin/bash: -c: line 0: unexpected EOF while looking for matching `’’ /bin/bash: -c: line 2: syntax error: unexpected end of fileeach_text_file’ from /Users/Travis/Library/Application Support/TextMate/Pristine Copy/Bundles/ActionScript 3.tmbundle/Support/lib/package_completion.rb:38:in ——


Simon - Aug 3, 2008

@Travis 1 - Looking at the find error output I think you’re using a scratch project which is something I’d not catered for. I’ll add the problem to my issue list and fix it soon. 2 - You need to use the alt-esc autocomplete key sequence. 3 - If you look in ActionScript 3.tmbundle > Templates > Project > compile.sh there is an example of how to open a file after successful compilation. I won’t be adding it as a default to the build command as build is a separate activity to run.


Simon - Aug 0, 2008

@Travis The bundles designed to assume that directories named source, lib, src and test contain source code. For example in the project I’m currently working on my Papervision source is stored here: ${TM_PROJECT_DIRECTORY}/lib/src/Papervision3D/src I’m not sure what’s happening with your import problem. Do you have any other details? Does it happen all the time? Are you using a ‘cutting edge’ version of TextMate - see Preferences > Software Update.


Ali - Oct 5, 2008

Hi Simon, thanks for the great bundle. Everything is working great but the index.html won’t open when the compile has completed. It’s set to do so in the compile.sh file like this: if [ “$?” == “0” ] then open “deploy/index.html”; fi If you can advise at all it would be much apppreciated. Thanks!


Tony - Feb 1, 2013

Hi Simon,

I came across your site on a search for flash and flex game dev, I use Sublime Text 2 I have textmate but prefer ST2, how do I make this work for Sublime Text 2?