Thursday, May 17, 2007

rule#2, not quite... (or: Flash and SL)

Ok, after being accused of not following the rule#2, I will need to rehabilitate. Looking back, I think I might not necessarily have progressed on this front all that well in the past day, but at least I did not talk about football, did I ? :-)

Anyway, as it seems like ahead of me I have some exciting evenings in the library studying The Vogue and other useful materials, I need to balance that. So, this post will be about something completely different.

I think first time I heard about flash and SL was when Reuters had made something with it, and in the interview I had read a vague statement that the QuickTime player built into the SL "supports flash". Okay, have to try it out, I said. Of course it is easier said than done. Since the RL is by far not all Flash and Roses, it took me a while to finally get to play with it - RL and other pet projects were furiously competing for my time. Also, since I am approaching this from the perspective of "code" rather than "drag and drop" like any normal person would - life is much more difficult than it could be. (And just in case you did not know - flash player has a full-fledged virtual machine, with it's own flash bytecode. All of this object-drag-and-drop thing is just to ensure normal people can use it too, I think).

So - the first stupid question - "since it is a QuickTime player, how do you embed the flash into QuickTime?". After some (re)search, which did not give the answer to this (incorrectly stated) question, I decide: "well, what if I try to just take a .swf, put it on the server and give it in the parcel video URL?"

Here comes another point. I did see someone ranting on the fact that the SL viewer supports only Flash 5. ("Well, 5 is high enough, no? Could have been version 3?" - the quick look at the flash 8.0 reference quickly made me understand the fundamental mistake. Flash 5 is... well...terse.)

And it looks like everyone but technomasochists, these days code at least in flash7. So, tough luck.. I will have to find something really-really antique to even try my assumption on how to deliver the .swf to the SL clients...

Luckily it was not my first attempt to get a closer look at .swf, and from my previous escapade I had remembered about the existence of Ming - a software library for programmatically generating the .swf files.

So, let's look at ming examples and see if it works... The first attempt brings the "media texture" completely black.. ahh this must be flash8...

Oh! Invaders! Let's try this one... IT WORKS!!

After the first yell of joy, time to calm down. No keyboard events. No mouse events. Well, I *thought* there was something being passed to the script, but not sure - could have been just a side effect of lack of sleep. So - let's assume no keyboard and no mouse...

The lessons learned for now: not quite what I hoped for, but yet still better than changing the colors on the prims. And some folks tend to do interesting stuff even with this limited toolbox. Does anyone know if a model of the Turing Machine already exists in Second Life ?

If yes I think I would make a contest and give a prize to the first person who takes that machine and makes it decode and play mp3s in-world - just to see how far the hackaround skills stretch...

No comments: