TAG Presentation 0

I presented early this morning (7am!) at TAG Austin. Nice crowd, very interested, very receptive. I spoke for about 45 minutes, slides presented below.

The presentation was broadly about Mockingbird, but Mockingbird-specific talk really just occupied the first and last five minutes, everything in between was a discussion of what games are, what their history and place is in human culture, what their potential is as a form of expression, and what elements of that expression are critical in order to make “making” as accessible as possible.

As with previous presentations, the slides by themselves may not be that useful, but for those that heard the presentation the slides should serve as useful reminders.

SWF Export from Keynote
PDF Export from Keynote

Loading Flex-based SWFs in AS3-only SWFs 6

One would think that Adobe would make the integration of Flex-based SWFs and AS3-only SWFs (including those produced by the Flash authoring tool) seamless. Everything works spectacularly if you want to load AS3-only SWFs (or what some folks refer to as Flash SWFs) inside of Flex-based SWFs. But the other way around? Good luck.

In fact, some comments in the Adobe bug database suggest that loading Flex-based SWFs inside of non-Flex-based SWFs is officially unsupported. If so, I'd suggest they change that policy promptly as most of the world still uses non-Flex codebases.

What's the problem? It all revolves around the SystemManager and how it bootstraps Flex-based SWFs. I'll not go into the details, but the problem is that if you don't do things "just so" the SystemManger for your SWF gets confused and doesn't act like the top-level SystemManager that it is.

The fix is easy... down right trivial -- once you know it. It's not in any of the current docs, and Google only leads to a lot of solutions that work if you're not dependent on the SystemManager doing much (such as handling custom cursors or doing complex layout). After lots of stepping through the SystemManager source under different load scenarios I ran across a couple of events (whose names are hard-coded strings in the source) whose purpose was never explained in comments or docs. A bit of Googling revealed this handy doc from the Flex team: Developing and loading sub-applications [PDF]. I couldn't find it's original context nor could I find it navigating the official help docs, so I'm not sure what it's actually a "chapter 1." of (my suspicion is that "chapter 1." is a by-product of their documentation templates).

In the last few pages of that doc they give an example that loads a Flex SWF in a pure AS3 app. Their example is slightly more complicated in that they are trying to load a set of common RPC components to be shared between two potentially different codebases. Our needs are much simpler. Here's all you need to do:

Actionscript:
  1. var loader:Loader = new Loader();
  2. addChild(loader);
  3. loader.load(new URLRequest("my-flex-app.swf"));
  4. loader.addEventListener("mx.managers.SystemManager.isBootstrapRoot", systemManagerHandler);
  5. loader.addEventListener("mx.managers.SystemManager.isStageRoot", systemManagerHandler);
  6.  
  7. function systemManagerHandler(event:Event):void { event.preventDefault(); }

We load the Flex SWF with a Loader, just like normal. We then add two event listeners on our loader (these could probably be on the containing SWF as well as they bubble up). These two events are dispatched by the SystemManager during its initialization phase. If it dispatches these events and nothing happens it makes bad assumptions and gets confused. We need to acknowledge these events. We do this by canceling them (calling event.preventDefault()).

The end result is that your Flex SWF will act completely self-contained. The SystemManager will assume it's the only SystemManager and it will manager everything as if it's the root of the Flex app (which it is).

I've not tested loading multiple Flex SWFs side-by-side with this technique. Due to some singletons (bad, bad singletons!) in the Flex Framework, I'm not sure if this would solve all of your problems as it may not properly coordinate multiple SystemManagers. One solution would be to further wrap the Flex SWF in its own application domain so that there was no cross-pollination of Flex Framework classes.

Picnik: Damn Good Flex 0

I'm pretty sure I've mentioned Picnik before. I got a reminder this evening about updating my expired credit card (for my annual premium). So, I visited the site. I hadn't been in probably six months.

I know they use Flex to build the site (which is what we use for Mockingbird). I haven't read anything about what specifically they do (though, I'm about to go googling that after I post this). Whatever they're doing, it's silky smooth.

For all those folks that say "why do we need Flash on the web?" send them to Picnik. They'll tell you that you can do most of that stuff in JavaScript (not anywhere as smoothly with most web browsers). They'll argue that an app like that should be native -- except that if it was the development cost would have been significantly higher and it would be functionally less useful for users who use multiple machines. The point is that Picnik was made in Flex, by incredibly talented designers and developers, and it was not made in those other environments. There are clearly advantages to the Flash platform that don't exist elsewhere, and those advantages are critical for the right application. Best tool for the job.

I know we made the right decision with Mockingbird (to have it built on Flash). I may be tempted at times by the extra horsepower others may offer -- but in the end, the Flash development environment and distribution platform is a warm, comfortable embrace.

The Unfinished Swan 0

The Unfinished Swan is a beautiful concept for a game. And, judging by the video provided, is being beautifully implemented. Within seconds of seeing it my whole perspective on first-person mechanics was flipped on its head.

Building Gaming’s Future 1

This morning I read Edge's article on building gaming's future. It's a decent summary of the growing audience/market for consumer game making. Of course, we've been talking about this at Mockingbird for a few years now, but Edge really hits it home with all of their examples that it's truly becoming a mainstream activity (for gamers).

Needless to say, I'm bummed that we didn't even warrant a mention, even though we were one of the first in the present push to get out there and do this. I'm cool with that because I know all of the other folks mentioned in the article (XNA, Whirled, LittleBigPlanet, Playcrafter) know who we are. ;-)

New Industry Broadcast 0

Ryan has recorded another pair of my blog posts over at Industry Broadcast. I originally wrote the articles over two years ago. Very strange to hear someone reading them. While I remember writing them, they don't seem like my writing when hearing someone else read them (they sound better!).

Mattel Gets Into the User-Generated Games Market 1

Mattel gets into the user-generated game business, according to this CES press release:

Virtual Worlds News: Mattel Developing Digital Network; Adding Game Creation to Funkeys.

I can say that we're apart of the strategy mentioned in this press release, and that I don't consider Mattel a competitor. :-)

Deconstructing Adventure Games 0

Great article on the interface of Adventure Games, the components that go into them, and their evolution over time [via Kottke]:

Strange Horizons Articles: Searching Under the Rug: Interfaces, Puzzles, and the Evolution of Adventure Games, by Mark Newheiser.

Industry Broadcast my blog posts 0

If you're interested in hearing someone read aloud my blog posts, check out IndustryBroadcast.com.

Mockingbird on Kongregate 3

We've posted our first build of Mockingbird on Kongregate. It's a platformer kit... start runnin' and jumpin'!

Over the next week, we're going to rework this version of Mockingbird and re-integrate it into our site. New things on the way...

Next Page »