Showing posts with label swfmill. Show all posts
Showing posts with label swfmill. Show all posts

SwfMillEditor, the "break-apart"

Saturday, September 12, 2009

After prototyping a single file with XML & hscript, i started creating proper classes for the different elements of the frontend application.

Currently, most of the work revolves the source editor, which is shown in the screenshot below.

When prototyping, the source editor was a simple window with an "onLoaded" action, that placed a textfield in it, made sure to resize it when needed, and maybe had a few other lines...

That code was replaced by a single line, instead of a window, an XmlEditor class, its imported into the main application, and sits in its own file, XmlEditor.hx, as something like:

class XmlEditor extends Window {
...
public static var layoutXml = Xml.parse('
// here comes its xml layout...
...').firstElement();

public function highlight() {...}
public function updateTree() {...}
...
}
This allowed much better writing, with the full power of haxe driving the bigger logic and small scripts handling the smaller, this is where it left its prototyping stage, and some of its features now are:
  • Llightning-fast highlighting with regular expressions
  • Tab\Shift-Tab indentation (with visual marks too)
  • Auto-close of opened tags
  • xsltproc can be called with indent.xsl to format the source
  • XML is parsed to a tree to provide a document outline (still slow as hell though...)
  • Attributes and values of the active tag (the one which contains the caret) are displayed in a list.

Second screenshot, shows the FileDialog class, tree is filled with directories, and the lists are filled with files and their stats, all data arrives via the neko backend, this should make it simpler to browse virtual filesystems too, like those that actually sit inside a remote database or in memory...

Checkout the shots below, and stay tuned for more, gershon.

P.S: sorry for the mis-spell on the note in the first screenshot, too late&lazy to fix it ;)

Prototyping the SwfMill Editor

Friday, August 14, 2009

Its been a great companion, and i just love it. How can you not love a program that takes 'simple' as an argument?

For me its been the simplest, whether i compile with MTASC and inject the logic into a swf containing assets linked to as2 classes, or add assets into haXe made swfs compiled to as3.

Its a small and wonderful tool, that integrated well into my workflow, saving me not only time, but also from the jaws of proprietary software...

But for a while now, i've been toying around with the thought of making it even simpler using a frontend. The screenshoot below shows that thought transformed to working code, you can see the application editing the very same files that have been embedded when creating it.

The details of what it does, and does'nt yet, are already annotated in the screenshot, i'll just add a word or two about its prototyping process. It took only a couple of hours to generate this little app, some of which involved fixing stuff in the framework, which takes longer and requires compilation in haxe, layouting and simple events are done in xml and only require a browser refresh. Other than the haxegui package, there are 3 files involved. First one is a xml file for the layout and some simple events, second is a hx file that is compiled to a flash9 target, it has a single class and static main function, it initializes haxegui, loads the layout and works the logic, like parsing xml and setting up event listeners. The 3rd file is also a single class hx, it compiles to neko, and is a server for files and for swfmill input and output. The whole thing is run in two stages, first i run a local neko daemon, using 'nekotools server', then i navigate to the server address to land in a 'index.html' page which embeds the swf.

No paid software, knowledge or service has been used to write, run and bring you this, i would love to have your ideas and comments on this one, a working demo and the code should be released soon...