FC64 wins Flashforward Film Festival

Darron already blogged it: FC64 won Flashforward Film Festival in the Technical Merit category. Ohhh yeah!

I promised i show you the FC64 trailer that was shown at the ceremony, so here it is:

http://codeazur.com.br/stuff/fc64_final/flashforward/

(takes a while to load, i didn’t bother writing a preloader)

The fun part of it is that the trailer is written in 6502 assembly and executed by FC64. Even more fun: FC64 loads the assembly sourcecode at runtime, compiles and executes it. The scrolling arrows are actually lots of custom 8×8 pixel characters, animated by the C64 graphic chips smooth scrolling feature. I used raster interrupts to switch scrolling off in the middle part where the text appears (we don’t want that to scroll).

Ok, i also cheated a bit. Credits go to Andre Michelle: i ripped the Super Mario mod off his fantastic mod player. SID emulation in FC64 is being experimented with at the moment by Martin Wood and Ralph Hauwert, but we don’t have anything stable to show yet. Be patient :)

ZIP it up!

Did you ever write an image gallery or a game in Flash? Did it bother you to write rather complicated load queues to load lots of small files such as image thumbnails or game assets like tiles? Are you working with big text files and need a reliable way to compress/uncompress them to save valuable bandwidth?

I’m proud to announce FZip, a cute little Actionscript 3 class i’ve been working on together with Max Herkender that enables you to load standard ZIP archives and extract contained files while the archive is still loading.

FZip is released under OSI approved zlib/libpng license.

Sample usage:

public function YourApp() {
   var request:URLRequest = new URLRequest("your.zip");
   var zip:FZip = new FZip();
   zip.addEventListener(FZipEvent.FILE_LOADED, fileCompleteHandler);
   zip.load(request);
}

private function fileCompleteHandler(evt:FZipEvent):void {
   var file:FZipFile = evt.file;
   trace("File loaded: " + file.filename)
   trace("  " + file.sizeCompressed);
   trace("  " + file.sizeUncompressed);
}

Check it out: FZip at côdeazur brasil lab

Bratwurst

Adobe Flex 2 Language Reference, class Class:

For example, if you are using an MXML compiler to generate SWF files, you would create an embedded class as follows:

[Embed(source="bratwurst.jpg")]
public var imgClass:Class;

Real Coders do Assembly

So our Flash Commodore 64 emulator project, FC64, got nominated for the Flashforward Film Festival recently (read my previous post). The 60 finalists are given the opportunity to submit a 45 second trailer showcasing the work, that will be shown live in front of 1000 people at the ceremony.

I won’t spoil it so i won’t show the trailer here (you gotta wait until after the Flash Film Festival ceremony or better yet attend it to see it). What i can do though is – in the spirit of open source – show you the source code:

http://codeazur.com.br/stuff/fc64trailersource.asm

The trailer is written in 6502 assembly and runs in FC64 – a real ‘Demo’. It actually should run as is in the original C64 hardware, and in any other C64 emulator. If i ever find the time, i’m going to prepare a binary image to load it into other emulators.

By the way, FC64 features an assembler (the souce code above is loaded and compiled at runtime into the emulator), as well as a disassembler and debugger. This is currently not reflected in the emulator UI and undocumented. Plans are to make the UI a full featured IDE for developing stuff for the C64.

I had hell of a fun coding the trailer demo, and it put me right back in the mid 80es when i used to waste night after night coding on my beloved bread box. Ahhh, memories.. :)

Back to AS3 development now, listening to Depeche Modes ‘See You’. Ha :)

Goodies for Flex2 Developers

I was invited by Adobe to join them in San Francisco for the two day Adobe Component Developer Summit (ACDS) last month. The event was a blast to say the least, surely the best developer get-together i’ve been to ever. I got to finally meet people that i know for many years now but never met before (you know wo you are), and the presentations were all very solid.

Ted Patrick (he set the whole thing up and receives my special thanks once again: was great meeting you, Ted) announced today that the speakers made their slides (and sample code where applicable) available to the public. It’s absolutely a great resource for developers who want to get their feet wet with Flex 2, or who want to dig deeper. My personal favourite presentation was Gary Grossmans “ActionScript 3.0 and AVM2: Performance Tuning” [PDF].

Check out Ted’s post “Adobe Component Developer Summit – Slides and Examples” for the download links.

[Oh and by the way, in case you missed it, the price winning and dug Commodore C64 emulator project FC64 that Darron Schall and myself have been working on in our free time for a while now is an open source project so feel free to check out the sources to see how we did it. Maybe you even want to contribute.. please drop me or Darron a mail, we greatly apprechiate your input]

Innovation, or the lack thereof… W3C, anyone?

I originally posted this on the OSFlash mailinglist, but i thought it would make a good blog post, so here it is:

My vision of a next generation web application framework.

(or: Innovation, or the lack thereof… W3C, anyone?)

There’s a sh*tload of XML dialects for GUIs either available or being developed at the moment. Just to name a very few: Adobes MXML, Microsofts XAML, Laszlos LZX, Netscapes XUL, and from the OSFlash camp ActionSteps ASML (or Renaissance) and ASWings AWML.

All of them are proprietary formats (plus most of them are direct projections of the underlying, proprietary APIs), and all of them require some decent amount of script code to be written in order to actually make the UIs work. Problems: to author sophisticated applications i need extensive knowledge of the XML dialect itself, of the API and the scripting language, and probably of the underlying platform API too. For most ‘next gen’ RIA platforms much of this is proprietary stuff, so i better choose wisely what technology to dive into for the next months/years. I also better be able to think ‘code’ in order to make my RIA a successful reality.

Wouldn’t it be nice to develop web applications using open, standardized technologies that everyone is already very familiar with? Let me introduce you to the W3C, and please try to forget about browsers in general and men with white beards wearing birkenstocks in particular for a moment.

Contrary to popular belief, the W3C is working on really cool stuff. Some of it you’re already very familiar with: (X)HTML and CSS. The *real* cool stuff though are W3C technologies that haven’t made it into the mainstream yet (because they aren’t supported by mainstream clients, or because they’re being worked on yet). I pick two of those technologies, XFrames and XForms, and briefly introduce them here, as i think that together with XHTML (2) and CSS (3), they pretty much cover everything a RIA framework needs.

XFrames
The technology that is supposed to supersede HTML Frames. XFrames of course is going to support framesets as we know (and hate) them today, but there’s so much more. Using CSS, frames can be styled to appear as floating windows or tabbed panes for example, and using a new URI scheme it will be possible to easily link not only a frameset but also it’s content, example: http://example.org/index.xframes#frames(id1=uri1,id2=uri2,...).

XForms
The technology that is supposed to supersede HTML Forms. XForms is going to significantly change the way we author forms. Basically, it separates the model from view and controller, as you can now have multiple data instances (usually XML, both inline or external) that you can use as data provider for controls and widgets (controls can be bound to data provided by instances using XPath). Validation is handled in a purely declarative way via XML Schema datatypes. But again, there’s much more, for example: <switch> and <case> to show/suppress parts of the UI (to be used for e.g. wizards, tabbed interfaces or dynamic forms), or <repeat> (to be used for e.g. filling tables with rows, or datagrids, or just about anything UI that repeats itself). Of course everything is styleable by CSS and can be bound to data instances. Sounds familiar? It sure is. And did you know that the latest ColdFusion uses XForms under the hood? Yes it does.

I recommend the W3C articles “XForms for HTML Authors” (Part 1 and Part 2) and Micah Dubinkos XForms Institute (hey look, he’s using DENG!) for a leightweight introduction to XForms (The XForms Institute also links a free online version of the O’Reilly book “XForms Essentials” in case you’d like to dive in further)

If you mix all those technologies mentioned above, and throw in some more, like SVG, SMIL, and maybe even XUL, that’ll be my vision of a sane platform for Web 2.0 [sm][tm](c)… ok, Web 3.0 it is then. A sane platform to develop RIAs on. Don’t even get me started ranting about the current state of the web as too many people see it. What the web needs is innovation, not hyped acronyms for old crap, or yet another proprietary markup language.

Of course such a framework needs to be developed yet. With the Flash Player 9 in our hands, the great performance boost compared to version 8 and a way better API (minus native text rendering.. still sucks), i’m sure it’s absolutely doable. If only somebody with some angel $$ would share my views, or if only everybody would work together with open minds instead of cooking their own soup…

We even have a proof of concept, anybody remember DENG? That was Flash Player 6. I’m also writing all this because i think most people misunderstood DENG and see it as a better HTML-enabled TextField or something, or worse, as a HTML browser. It was supposed to be the beginning of an application framework. Of course it’s missing A LOT yet to really become one (and of course Flash Player 6 was way too slow to do such stuff), but again, with Flash Player 9 and some likeminded developers, this could become quite a blast.

Thanks for listening :)

Addendum: Some good and valid remarks and questions i got in the OSFlash mailinglist:

This is, in my mind, a brilliant idea especially when you throw in Haxe‘s planned ability to render to different (and future) runtimes (I assume that you would use Haxe to do this).

One of the most frequent issues on the Haxe list is the lack of a component written for Haxe. I think that a project like this would solve that issue for Haxe.

I’ve looked into Haxe. It sure looks promising, and It’d be a major plus that a framework written in Haxe potentially wouldn’t have to be tied exclusively to the Flash Player. The first thing i would do if i would start to develop such a framework in Haxe is write a compliant DOM3 Core implementation that works exactly the same in Flash 6, 7, 8 and 9 and in all mainstream browsers. That alone would already kick some serious bottom.

I glanced through the XForms documents on w3c and was wondering if it would be possible to leverage one of the existing component sets (specifically ActionStep or ASWing) to complete this task? To me, it would seem like a much smaller job if we used an existing framework.

But could we imagine to bind a standard Flash XFrames/XForms/CSS parser with any/a few GUI toolkits? That would actually be great, but is it possible to achieve?

I have been asked this question many times already. Theoretically, this is possible. However, if i would develop such a framework, i would surely want to implement CSS3 which features styling and skinning mechanisms that imho beat those implemented in all current GUI toolkits together, and integrates perfectly into all mentioned W3C technologies. So depending on what toolkit you use, you probably can only implement a subset of CSS3. I also think that it wouldn’t be very easy to integrate custom component sets, or rather, i think it wouldn’t be worth the pain.