HaxeBridges – Inter-platform coding library

HaxeBridges is a library which allows a single project to be compiled into separate parts, and for separate platforms. This is useful for many situations, including when multi-threading, client/server, etc. The idea is that your main application should be able to naturally use objects which will be published via a different platform/compile. The example included in the repository now is a simple example of creating a worker thread (flash only for the moment). In the main class: 1234 var obj = new ObjectInsideWorker();  obj.nonStaticMethod(function(result){     trace("Worker result: "+result);  }); And the class which gets compiled into the worker: 12345678910package; class […]

Posted in: Code Thoughts by tom No Comments

RD32II Action Camera AVI file issues

I recently used a small video camera for an overseas journey and realised on return that the video files generated are formatted in such a way that prevents them from being read by most professional video editing/converting software. To get around this took a little research, so for those who are having similar issues I thought I’d post how I fixed the files. These instructions are for Windows, if anyone converts for use on OSX please post in the comments. First, download ffmpeg, look for the link with “Static” in the title under the correct OS type heading (32-bit or […]

Posted in: Code Thoughts by tom 3 Comments

SMIL test page

Posted in: Code Thoughts by tom No Comments

Export Flash to Animated SVG

While working on a project which required rich vector animations in the browser, I came across Dave Belias’ library for exporting still SVG frames from flash. I wondered if I could re-purpose it to export Animated SVGs, a relatively unknown standard for containing fully animated imagery within a single SVG file.

Posted in: Code Thoughts by tom 27 Comments

Export Illustrator Layers to SVG files

I’m currently working on an Adobe Edge job, it’s almost totally vector based, and it turned out there were few quick options for breaking Illustrator files down into multiple SVG files. After looking around, I decided to add features to Matthew Ericson’s awesome exporter script. Adding the SVG export format was easy enough, unfortunately I ran into another problem. The original tool was built for raster outputs, and whilst it did support EPS, each EPS file that was generated actually had all layers included (all invisible except one). So after some reworking I got it to generate small vector SVG/EPS […]

Posted in: Code Thoughts by tom 60 Comments

In Defense of XML

Over the last few years XML has become a very unfashionable standard and especially in the Haxe world has drawn a lot of fire for being too verbose and containing too much redundancy. I still use XML when I feel it’s appropriate, and I wanted to explain why. When is XML the wrong choice? In the past, XML has been used as a way of serialising data as input for a known web application (either from the back-end or from a file). I see this as a misuse of the technology. If it is not a public service, it has […]

Posted in: Code Thoughts by tom 3 Comments

Guise: Unified UI for Haxe

Haxe is a great platform for future-proofing your work, and with NME it provides a solid tool-chain for cross-platform native development. Unfortunately, it lacks a real solution for the issue of user interfaces. That’s why I’ve been building Guise, a UI library for native and non-native user interfaces. Ideally, Haxe should have a UI system that does the following: Should be able to be dropped in quickly and easily, with little setup code. Allows the use of native controls where desired. Allows the developer to switch to non-native (i.e. drawn) controls when the design requires. Future display libraries should be […]

Posted in: Code Thoughts by tom 13 Comments

XInclude for Haxe

When working with XML files, it’s often convenient to break the data structure down into smaller parts, each saved within a separate file. There is a standard called XInclude which allows XML sources to reference other XML sources which can help reassemble your separate files into one structure. As part of my XML Tools library, I’ve implemented an XInclude system which takes in a root XML file, loads in any referenced XML files and returns the complete XML structure. Note: I’m well aware that XML has become the whipping boy of the web-dev world, but despite it’s verbosity we still […]

Posted in: Code Thoughts by tom 1 Comment

E4X Macro for Haxe

I recently needed to navigate some XML in Haxe and noticed that there were few options for doing this quickly and easily in Haxe. I did notice Oleg’s Walker class which brings some of the E4X functionality of AS3 to Haxe. While the resulting code was more elegant than hand-writing loops and tests, it still felt too verbose, and I decided to add some macro sugar to it to cut down the syntax (and bring it closer in line with the E4X spec). The result is the E4X class, which reduces the amount of code by 2-3 times (in comparison […]

Posted in: Code Thoughts by tom 7 Comments

Fitting Text into a Box

On a recent job I was tasked with creating a visually elegant replacement for an image out of some text (when an image was unavailable). I decided to adjust the font-size of each line of text in a block to fill a box. The result is the TextBoxTest class. To use it, you create a text field, set it’s properties (text/size/multiline etc), then send it to the TextFitter class like this: 12345var field:TextField = new TextField(); field.text = "THIS IS SOME DEMO TEXT."; field.width = field.height = 50; field.multiline = field.wordWrap = true; TextFitter.fit(field); The second parameter is ‘defaultSize’, this […]

Posted in: Code Thoughts by tom No Comments

Haxe Lazy Instantiation Macro

After finally settling on msignals as the event system used in my libraries, I turned my attention to cutting down the amount of code required to use it. To minimise the memory overhead (and dispatching performance) of signals, I prefer to use lazy instantiation. But this can make the implementation a bit verbose. Hence my lazy instantiation macro, it only cuts out 3 lines per signal, but makes the code considerably more legible.

Posted in: Code Thoughts by tom 5 Comments

Space Junkie update

In my spare time I’ve been working on a game for mobile. It’s based on Haxe/NME and Nape Physics. In this demo you can also catch a tiny glimpse of my upcoming GUI library (using the Chutzpah skin by Morgan Allan Knutson). Click flash to focus, Arrows to move

Posted in: Code Thoughts by tom No Comments

Generating Docs for Github Wiki from Haxe code

Following some pretty good feedback on Composure, the composition library for Haxe, I decided to get some code documentation published. The result was a batch file which would generate documentation in Markdown format, which can then be manually committed and pushed to the github wiki. You can check out some examples of the results here, here & here. The Documentation system I wanted to have something generated directly from the code, and I had a preference for having it hosted within the Github Wiki system (for the simplicity of having code and docs accessible from the same place). When a […]

Introducing Composure for Haxe (with Dependency Injection)

Over the years I have realised that inheritance is massively overused by developers, and that by replacing it with a solid composition design, a lot of code becomes a lot more reusable. Some languages and platforms have native support for composition (e.g. Unity3D), but for the languages I use there was nothing, so about two years ago I built a lightweight composition framework for AS3 called Composure, I’ve recently completely rebuilt it for Haxe, utilising Haxe’s awesome typing and macro systems to make this small library really powerful.

Posted in: Code Thoughts by tom 4 Comments

Internet Archive Android App

Betty Page - Party Doll

I’ve just released a new Android App. It allows you to watch out-of-copyright videos from the Internet Archive Database on your phone or tablet. It’s currently early days and it doesn’t really have any browse functionality yet, just search fields. An iOS version will be coming soon also.

Posted in: Portfolio by tom No Comments

Evolvex Furniture Builder

Untitled-2

In this flash app I built for Evolvex, users can assemble furniture from different components in a 3D environment. When finished the furniture can be purchased, all of the components, along with a diagram of the furniture gets sent to the user.

Posted in: Portfolio by tom No Comments ,

SWC packaging ANT Task for Flash Builder

I ended up writing an ANT task which can build an SWC based on a Flash Builder project file. This way I could integrate regular SWC creation into my deployment process, backing up all external code.

Nokia Bill Exchange

Nokia Bill Exchange

This is a microsite I built for Nokia with the great group at JWT. I built the physics portion of the site, all of the items and navigation moving around in the background using Box2D. I also built several of the pages.

The Bad Eggs

I’ve been doing some work down at JWT recently and found myself building this silly physics prototype. You can add eggs and then smash them against one another or the walls.

A more general CSS

As a language, I like CSS, it has a simple elegance that achieves it’s humble goals very nicely. It’s these humble goals that bother me. HTML is an XML based language, and fundamentally, all CSS is doing is targeting nodes within this XML and modifying their attributes. Of course, it’s not possible to, for example, modify the href property in an anchor tag, and this shows that the implementation of CSS is stifled by it’s modest goals. Also, CSS’ ever-growing list of selectors shows a fundamental inflexibility in it’s syntax. Selectors basically target specific nodes within your HTML, this sounds […]

Posted in: Code Thoughts by tom No Comments