Flash MiniBuilder: Online AS3 IDE – Part I
Flash MiniBuilder: online AS3 IDE, edit (with code assist) and compile swf online.
Flash MiniBuilder Part I
Flash MiniBuilder Part II
Flash MiniBuilder: Part III – AsWing
This project, currently named ActionScript MiniBuilder, features code assist (code completion) for ActionScript 3 and compilation of one-file AS3 SWF. It runs in your browser, you only need Flash Player 10 and Java. The code assist part is written in pure ActionScript. The compiler runs in a Java applet.
Though it’s in early stages, the currently implemented set of features includes:
- Solving existing names: the resolver searches recursively the current and parent scopes, the inheritance chain and imports.
- Hints for new names: the resolver searches scope, inheritance and all importable things – that can be class, interface, functions and vars defined at package level.
- Hints for new types. (class/interface): the resolver looks in all type database.
- Autoimport: when a name can’t be resolved in scope and existing imports, and can be resolved by using a new import, the new import is added to script.
- Triggers: several chars and char sequences trigger the code assist hinting as follows:
- “.” -> list members
- “:”, “new”, “as” -> list all possible types
- “(” -> hint function/constructor parameters
- Simple expression evaluation (just 2 for now):
- ’string’ and “string” are of type String and hinted accordingly
- (expr as Type) is evaluated as Type and hinted accordingly
So you can have things like:
(value as Type1).doSomething().memberName.doOtherSting().otherName
resolved correctly.
Now, let’s play!
Here’s a first example (edit source then click “Compile and Run”):
Note: for code completion, flash player is enough, but you need Java plugin in your browser to be able to compile/run. The compilation is done at client-side, so don’t worry about server load. Have your time and play with it as long as you wish. You can bookmark this page to use it whenever you think Flash or Eclipse starts too slow for a simple script.
What’s next:
- A project manager for multi-file projects.
- A swc parser to provide hinting for external classes and other names.
- Integration with Flex SDK, code hinting for MXML or other layout markup.
And small but important enhancements:
- line Numbering
- search / replace
- hints for typed Vectors
In the making
ActionScript is not the fastest thing on Earth, we don’t have background threads and there are other limitations. Still, using a few tricks, like slicing tasks to mimic threading, doing the minimum of computing right when it’s needed and caching results until new ones are available, we can build pretty powerful stuff.
Considering the programming effort that was required to build MiniBuilder, these are the
main components:
- ScriptArea – a textarea control that can be used to do real-life code editing. It can manage 5-10,000 lines of code without becoming very slow. It features (almost) all common key and mouse combos to control cursor and selection, fast font formatting, which is a must for real-life source code. Unfortunately, due to some limitations of FlashPlayer, you cant properly insert some UTF8 chars (keyboard and paste both are affected). I’m searching for a better solution.
- Code assist – parsers, resolvers, type database. This is the core of the project.
- Java Applet AS3 compiler (based on asc.jar from open source Flex SDK)
MiniBuilder uses ASWing which provides a powerful pure AS3 component framework.
ActionScript MiniBuilder is released under MPL license.
There are lots of known bugs and limitations, I’m not going to list them now here, but I’ll be
happy if you fill in an issue at the google project’s page (project’s URL in Part II). Or simply add a comment here.
Depending on how much feedback the project gets, there will be more or less future inhancements,
so feel free to state your opinions, bugs, requests.
Stay put, in few days comes Part II with more details about MiniBuilder and a new example.
Any contribution to the project is welcome!
Next: Flash MiniBuilder Part II
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



July 6th, 2009 at 4:38 pm
[...] Flash MiniBuilder: online AS3 IDE, edit (with code assist) and compile swf online. This project, currently named ActionScript MiniBuilder , features code assist (code completion) for ActionScript 3 and compilation of one-file AS3 SWF. Read the original here: Flash MiniBuilder: Online AS3 IDE – Part I [...]
July 6th, 2009 at 6:15 pm
Very cool. Some minor things I noticed:
new Array(). <– produces code hints for the Array class rather than array instances. Same applies to casted values (i.e. Array(someValue). <–). Of course using “as” seems to work which was a nice surprise
The vertical scroll bar does not update after loading in a new file.
There is no automatic horizontal scrolling while dragging (vertical is ok)
catch() error variables are not code-hinted
The code hint box gets cropped when it appears at the bottom of the screen. When it “closes” it also appears to just go behind the main text editor pane rather than being removed from the screen as it appears behind the editor when it closes from a low-screen open.
July 6th, 2009 at 6:57 pm
[...] http://www.victordramba.com/?p=31 [...]
July 7th, 2009 at 4:51 am
[...] ActionScript 3 Log » Blog Archive » Flash MiniBuilder: Online AS3 … [...]
July 7th, 2009 at 6:06 pm
Hi!
I’m so interested on this project. I’m a Java/Flex certified programmer from Brazil, if do you want any help it will be a pleasure for me join at the dev team.
Thanks!
July 8th, 2009 at 12:29 am
Ahh. Sad it is modified Flex compiler. Hope some day AS3 compiler written on AS3 will be made
July 8th, 2009 at 1:25 am
oh man this is too cool. thanks for this! even without multi-file support, still very useful. gonna play with it a lot.
July 8th, 2009 at 1:59 am
[...] 更多介绍:http://www.victordramba.com/?p=31 Tags: ActionScript, IDE, tool [...]
July 8th, 2009 at 3:08 am
[...] Check out: http://www.victordramba.com/?p=31 [...]
July 9th, 2009 at 9:26 am
This is really amazing – completion works great and is pretty responsive.
Only “little” problem (maybe related to my french keyboard): I can’t type numbers, dot, @, curly braces, square brackets, and probably some more things…
July 9th, 2009 at 9:47 am
@Philippe
This is a very nasty one. Currently, the scriptarea component only works with standard US keyboard, because KeyboardEvent.charCode returns the US associated key. Haven’t decided what to do yet, but as a quick fix, we can add a few most used keyboards as maps in the application. Hope i’ll find a better solution.
July 9th, 2009 at 12:54 pm
To me, the biggest opportunity for a flash-based IDE is collaboration.
July 9th, 2009 at 12:55 pm
Seems like the auto-complete menu even pops up if the variable is not even defined yet. Like if you go into the first line of the constructor and write “s.” the menu will pop up.
Also PageUp/PageDown for that menu would be helpful
July 9th, 2009 at 2:13 pm
@gencha
that behavior is intended, check ecmascript specs. the compiler is required to move all local var and function declarations at the beginning of scope block. here, flex builder does not do it right. also, it seems to attribute scopes to blocks that do not define a scope, like if, for, while.
page up/down and cycling through the list will be added
and a lot other features, like help for each item
thank you guys, it helps allot to have all the bugs, feature requirements written here
July 9th, 2009 at 2:53 pm
This is a great resource. Thanks!
July 9th, 2009 at 6:52 pm
@Victor
Ah, interesting. I was not aware of that. It seems kind of counter-intuitive.
One thing I noticed is that when you’re at the end of a line and press tab, it appends a tab. If you then press shift+tab it moves the whole line (I was expecting that only the tab would be removed). Is that intended as well?
July 9th, 2009 at 7:36 pm
@Philippe
i implemented a fix for the keyboard layout problem. it should work now. make sure you clear the cache, the version should say 0.0.1c
let me know if it works
@gencha
yes, that is how i see things. shift tab will always unindent the line(s). also flex builder does that.
note: there’s one intended limitation of minibuilder text rendering: the tab char will always be displayed as 4 spaces, with no column alignment. it’s an important speedup.
about var: as3 is an extension of javascript (ecmascript) and it has to follow the specs. the nice effect of this is that you can simply paste js code in as3 and (with minimal changes) it will work. if you want a language more elaborated, check haxe. or java.
July 10th, 2009 at 6:17 am
[...] svaka čast, a vi možete pogledati ovaj alatić i ocijeniti koliko će vam on trebati – Flash MiniBuilder. [...]
July 21st, 2009 at 1:13 pm
Hi, finally tested it.
Good work so far..
I’m not getting any copy/paste function though, not sure if it’s just me. (i’m using Chrome as browser).
My code also doesn’t run, but it runs fine on Wonderfl.
Again, awesome work. The syntax-coloring, code-completion are superb. Keep up the good work!
July 21st, 2009 at 1:49 pm
@John
10x, i’m still on it
* compiler. asc as compiler is limited. wonderfl compiles with flex api, a complete compiler. i chose asc, just a small part of flex, to be able to deliver a small jar, being a web based app.
for the compiler i have 2 options. i’m now trying to convince asc to deal with more complex code. i’s possible, but not easy. the other option is to modify the mighty mxmlc to run all in memory. after lots of work, anyway, this will result in a jar with a minimum of 15-16M, not realy good for a web page.
please send me the code that did not compile!
* code completion is in work also. there are bugs and limitations. one of them is that it makes no distinction between public an protected. for the moment, only privates are not visible outside the class.
nevertheless, minibuilder is already a tool you can use for small geometry calculus or animation tests.
* the desktop version is the next step. that one will use flex builder and will deal with projects. swc parsing is a must. but for now, i’ll try to make this web version a bit more versatile.
stay put, more interesting stuff to come!
July 21st, 2009 at 2:13 pm
Wow! This is really cool. Amazing how far Flash has come.
July 21st, 2009 at 2:54 pm
@John
copy/paste, i didn’t notice, yes, i lost copy/paste when i did the trick to support non-us keyboard layouts
will be fixed in next release
August 21st, 2009 at 8:53 am
Good and powerful!
September 11th, 2009 at 5:58 pm
[...] Flash Creation with Flash Minibuilder [...]
October 12th, 2009 at 1:09 pm
100% loading but nothing happens…
December 1st, 2009 at 4:06 pm
does not show “void” in the list of completion options after I type “:v”
December 1st, 2009 at 7:22 pm
mack
true. it’s comming
this online version is absolete
check this http://code.google.com/p/minibuilder/
January 5th, 2010 at 12:44 pm
good job!
severely lacking copy/past in editor
January 5th, 2010 at 1:22 pm
copy/paste works only using the keyboard (Ctrl+C, Ctrl+V)
be sure you also check the desktop version of MiniBuilder
http://code.google.com/p/minibuilder/
February 17th, 2010 at 1:00 pm
[...] no lo crean, esta persona desarrollo un MINI FlexBuilder en AIR….si, si, como suena. El tipo armó un entorno de desarrollo OpenSource que permite utilizar [...]
May 25th, 2010 at 10:05 am
[...] are some applications built using AsWing of which the Flash Mini Builder is an interesting [...]