Archive for the ‘Screenweaver HX’ Category

Screenweaver HX, file I/O and UTF8: A cautionary tale

Thursday, February 1st, 2007

As I mentioned in a previous post, I’ve been using Screenweaver HX to build a little seat-planning app. Well, thinks got a point today where I was ready to start importing the client’s list of attendees (an Excel sheet, naturally). So I decide to go the time honoured route of exporting a tab-separated text file and parsing that in Flash, after getting the contents in via a file open call in the haXe backend (file I/O in Flash! Hurrah!). However, as soon as I do this, Flash chokes on the import.

Now this is weird, becuase I’d been using exactly the same file open stuff to get in my development testing data (a nice, sane XML file) and the app had been playing just fine. Long story short, after banging my head against a brick wall for a few hours (even to the point of offloading all the parsing to the backend, and passing a neatly parsed array to the hosted SWF, which also failed), I figured out that Flash was choking because the offending text file wasn’t UTF-8 encoded. A quick insertion of this line:

content = neko.Utf8.encode( content );

into my file opening method in the backend solved all my problems and I could loosen my jaw muscles again :)

So, the moral of this story is (besides always read the friggin’ docs) is: if you’re doing text file I/O in Screenweaver, always make sure you UTF-8 encode before handing it over to Flash. Here endeth today’s lesson.

Screenweaver HX

Tuesday, January 30th, 2007

So I’ve been playing about a bit with Screenweaver HX recently in order to make a little app to generate seating plans for some swanky industry dinner or other (but that’s another story).

So far it looks pretty cool – once you get your head around the fact that, unlike with other extended projectors, the functionality of the projector is defined by another script (written in haXe, which also looks pretty awesome), which you have to write and compile yourself. Of course, this makes it about a gazillion times more flexible and extensible than any other extended projector I’ve come across, but also a bit of a headfuck. So much like any other open source effort then :)