I’m a big fan of Unity3D, great for cross-platform 3D games. So I was glad to find out from my colleague James that Unity is coming to iPhone, a platform I have also invested a good amount of my time in recently.

Typically Flash has formed the basis of my work over the last 7 or 8 years, but I’m finding now that the technologies are all so similar, it’s just syntax (and more often than not those are nigh-on the same). We are also more able to apply our learnings in say Papervision, to OpenGL ES for iPhone or Unity without too much of a learning curve, and more importantly, we have many more options for spreading our ideas across a wide variety of media without incurring the enormous costs that multi-skilling in those areas could have meant before.

On a similar note we now have a new version of Director to play with, which adds yet another possibility to the mix. Previously bandwidth and the cost of being online put a spanner in the works, now it looks like it is time to realise some of the things we used to suggest.

So it’s a very exciting time and hopefully I’ll have more to say (and share) regarding these technologies so stay tuned. :)

unity

Quote:

“Move Media Player and Microsoft’s Silverlight To Create The Most Flexible, High Quality Streaming Video Platform”

Here’s a strange one. Move Networks is offering a HD video player “powered by Silverlight” that comes in the form of a Firefox extension. Once installed you are redirected to a page that shows a HD video, but a look at the source shows the video player header and controls/progress bar are all made in Flash, it just overlays a block, streaming in a QMX file (doesn’t open in Windows Media Player when renamed asx).

It seems a lot of effort to go to, cross communicating between Flash, JavaScript, Silverlight and Firefox, when you could have made the whole player using just one technology. I don’t get the point of the Firefox extension in the first place, the video controls require Flash Player anyway, and if they had used Silverlight for them you’d need that plugin so why bother with this extension at all?

Try it here.

There are a few posts out there relating to Shantanu’s disclosure of a standalone Flash Player being developed for the iPhone using the newly released SDK, but of course that doesn’t answer the question as to whether people will be able to browse the web and view Flash content in-line, given that Flash makes up a huge chunk of the web, and also provides the revenue for a great many sites through advertisements (fallback GIFs are not what advertisers are paying so much money for).

I’ve been learning Objective-C and the iPhone SDK over the past week and it seems to me there might be an alternative option in using the WebKit engine, available in the SDK. Potentially identifying SWF embeds in web pages and replacing them with a Flash Player control. One thing I’m not clear on is whether this violates the agreement put forth by the SDK. In particular…

“No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple’s Published APIs and builtin interpreter(s).”

As a side-note, the iPhone SDK is a pretty well made package. If it weren’t for the possible confusion between the various frameworks and component parts that have arisen over the years, Carbon, Cocoa, QuickTime, Core Graphics, Core Animation (Leopard and iPhone/iPodTouch only) it would have been even better. But overall the video tutorials, reams of documentation and samples make learning these things fairly easy when compared with what you might have to go through; considering Objective-C is only a very thin layer on top of C, and for me had a much stranger syntax than C++ (when you assume Java, C#, ActionScript are all strikingly similar).

Ran into a couple of issues today with Flash Player 9. I’m communicating with a server which uses REST-based services and is very “standards compliant”. So when PUTting* to the server, it was responding with a HTTP 201 code (that’s a “created” response) and a 204 status code for a DELETE*. The Flash IDE was choking on this and generating an IOError, unable to read the stream. (*as a sidenote Flash Player doesn’t support the PUT or DELETE verbs right now, so we were using POST instead, and using a request header (“X-HttpVerbOverride”) to specify the correct verb.)

The IOError is of course pretty fatal, but I wondered whether it was just the Flash Player in my CS3 IDE which is not the most up to date (I still can’t install the 9.0.2 CS3 IDE update for some reason). So I tried everything in the browser and all seems well. So right now that’s good enough for me, if anyone can confirm this is fixed in 9.0.115 or later that would be great.

The other issue was with the X-HttpVerbOverride custom request header I was adding to overcome the lack of support for PUT and DELETE. It wasn’t being sent (using Charles to check). This one is easy to fix… just make sure you are sending some data in the request and that the request is a POST and all’s well again.

In a press release today Nokia announced that Symbian OS will include Silverlight. This includes both high-end S60, and low-end series 40. Silverlight is of course the cross-platform RIA runtime from Microsoft, that can be considered a subset of WPF (at least with version 2.0 which has a substantial feature list).

I wonder if Microsoft charged a per-device license fee to Nokia like Adobe did, and if so what the difference is. On top of that there was of course the controversial price to pay for the developer edition of the Flash Lite runtime for Series 60 which is thankfully now free. Clearly there is a fierce competition to be had in this space as the web continues to leak out onto what we currently call “devices”, and Microsoft have made it crystal clear Silverlight is high on their list of priorities.

Personally I see Windows Mobile taking a bit of a dive with the strong competition from RIM and Symbian, and more interestingly Google’s Android which I have extremely high hopes for. With that in mind, it’s sensible for Microsoft to find alternate, more up-to-date platforms for continued expansion, and just like the Flash Platform, a ubiquitous WPF/Silverlight stack would provide this.

When the iPhone came out, I thought it was a brave move, but I couldn’t see myself getting one, even though I’m a bit of an Apple fan (my MBP and Nano/Nike+ are irreplaceable). But since then I’ve been using a friend’s Jailbreaked iPhone I’m utterly sold on it (and the Touch), but for a different reason….

The combination of large touch screen, fast processor and accelerometers makes this device a sleeping giant in the handheld games market. The Nintendo DS and PSP have widened the audience considerably, with games like “Brain Training” on the DS, and World Series of Poker et al on the PSP squarely aimed at adults, and many games specifically targeted at girls. They are making gamers of people who would probably not consider themselves gamers at all… even after spending 3 hours straight playing 42-in-1 ;)

Apple are soon to release an SDK to game developers, I imagine these will be sold on iTunes. Like Nintendo, Apple prefer to keep a firm handle on anything that can alter the overall experience of using one of their products. Having said that if you haven’t seen some of the stuff coming out of the iPhone/Touch homebrew community take a look at some of the videos below.

Table-top Labyrinthe/Maze

I was amazed at the sensitivity of this one, no lagging at all, highly intuitive and tactile. Tilt the device to roll the ball.

Trism

A classic puzzler that uses the touch screen to slide “prisms” to form combinations… also uses the accelerometers to let the rows slide in the direction you are tilting the device.

iPhysics

You may have seen similar for desktop and DS, this delivers the same sort of experience as line-rider but involving many more objects.

It’s my birthday later this week, and I was lucky enough to have been bought an iPod Touch by my girlfriend so I’ll be Jailbreaking it later today and getting some of this on there. All in all, I expect the iPhone/iPod Touch to prove to be a significant contender in the ever expanding games market. One to watch.

My colleague James Hay has been experimenting with Processing, working with some public data made available on the UK government’s statistics site:

http://neighbourhood.statistics.gov.uk/dissemination/Download1.do

The end result has been captured below, showing cylinders whose height relates to the population and whose position on the map relate to the GPS coordinates for the post-codes in the data.

On a similar theme I’ve been reading Programming Collective Intelligence, O’reilly publishing. This book contains all manner of interesting discussions and examples (in Python) related to the analysis and use of large data sets. Some uses include a “PageRank” algorithm, a simplification of what Google might use, and a “recommendations engine” as you might find when browsing Amazon.

The book is fairly dry, but if you are a geek that likes to deal with practical algorithms I’d definitely recommend it. There are a couple of definitions given to the term Collective Intelligence, both relating to the power of crowds but another definition relates specifically to the superhuman intelligence exhibited by large groups of people when solving puzzles, the “hive mind” if you like, and this usually manifests itself in a viral manner. This effect was superbly illustrated by the I Love Bees and the Iris alternate reality games (the latter of which was a product of our AKQA San Francisco office). A paper was recently published by Jane McGonigal, PhD, going into incredible detail on the production and execution of I Love Bees and again I thoroughly recommend the read (PDF). AKQA also created an interactive walkthrough of the Iris campaign, featuring videos, commentary and a timeline of events.

It’s that time again, the Adobe sponsored London Poker Event is back. Luckily for me I can make it this time, and I hear from friends it was a great night last time round. It’s been a while since I’ve played but with such a mix of people there the prizes are anyone’s ;)

Huge thanks to Sean and Adobe for making this happen. Here’s the info, link at the end:

The second Adobe sponsored London Poker Tournament (organised by Sean
McSharry
) is taking place on Monday 25th February at the famous Loose
Cannon poker club in Cannon Street EC4. The event is FREE and open to all
professional Adobe software users. Adobe are taking care of the bar tab
and providing some impressive prizes for everyone who makes it to the
final table. Don’t worry if you’ve never played poker before, there will
be lots of novices and you all get 20 minutes of training before the event
begins.

Invariably it’s the beginners who usually do best, as was born out by the defending champion, Steve Riglesford, who will be there to see off all challengers, flaunting his winners bracelet no doubt. The event is next Monday and there are still some places left, so go to www.pokercoder.com and sign up quickly if you want to attend. You have to
register at the site to get in on the night.

You’ll also get the opportunity to network with Adobe representatives and fellow industry
experts (an invaluable career opportunity and a really great bunch of
people).

Sign up for this free even at www.pokercoder.com.

So there’s a problem with using gotoAndStop() in AS3 classes, as soon as you call it, you temporarily lose access to items on stage (on the timeline) whether they are defined as member variables, or using getChildByName(). This is different from AS2, items on stage were immediately accessible.

Why use the timeline at all? For one you might have a simple button using named keyframes as button states, or when dealing with assets created by designers that include animations with portions that require localisation of text. So like before you use gotoAndStop() or gotoAndPlay() to manage which “state” your MovieClip is in, but when you go to access anything on stage, it is null, even if it was on the previous keyframe. Here’s a snippet from a typical AS3 class:


...
public var myTitleField: TextField;

protected function onAddedToStage( event: Event ): void
{
  myTitleField.text = "Step" + currentStep; // All good
}
...

But how about changing the current frame as a result of a mouse click for example:


protected function showNextStep(): void
{
  gotoAndStop( "step" + currentStep );
  myTitleField.text = "Step" + currentStep; // myTitleField is null!
}

Ouch, so unlike AS2, you cannot reference something on stage after a gotoAndStop()… I know! Wait a frame!? Afraid not. Waiting a frame (using a callLater or simply hooking into one ENTER_FRAME event broadcast) will not be long enough. But there is another event dispatched by Stage which might work, Event.RENDER.

I think the event sequence goes something like this:

  1. myTitleField is defined here
  2. gotoAndStop( “step2″ );
  3. myTextField is null here
  4. Event.ENTER_FRAME is dispatched
  5. myTitleField is still null here
  6. Any code written on the keyframe itself is executed
  7. stage’s Event.RENDER is dispatched
  8. myTitleField is defined again!

So thanks to a tip from Senocular, the RENDER event looks like what we need. To force this event to fire, you must call stage.invalidate(), also the event is only dispatched to items on a DisplayList, and on top of that, it doesn’t go through a typical capture phase, the event is broadcast directly to the DisplayObject, but that shouldn’t matter here.

Ok so a sample might now look like this:


...
public var myTitleField: TextField;

protected function onAddedToStage( event: Event ): void
{
  myTitleField.text = "Step" + currentStep; // All good
  stage.addEventListener( Event.RENDER, onStageRender );
}

protected function showNextStep(): void
{
  gotoAndStop( "step" + currentStep );
  stage.invalidate();
}

protected function onStageRender( event: Event ): void
{
   myTitleField.text = "Step" + currentStep; // myTitleField is back!
}

So that’s fairly crude, but the idea is there. I was speaking to Tink who suggested that we override the gotoAndStop/Play methods in a base class to automatically call stage.invalidate().

Really you want to wrap all of this up in a base class and hook it into a redraw cycle so that you don’t have to add the stage RENDER listener and handler each time you need to do this.

In my case, I have a base View class that contains some simple functionality such as a Flex-like initialization phase and callLater method. I’ve also added these overriden methods and in my case they call invalidate() on my base class, which invokes the “component-like” redraw function whenever a property is changed and it’s time to update the visuals.

My initial reason for doing this was because of shortcomings in Flash’s built in SimpleButton class, which doesn’t appear to allow for localisation or font embedding when switching states, so I ported an AS2 SimpleButton I had written.

This issue is a major annoyance as without using this workaround you are basically locking out designers from working on FLAs, and using code for everything, which isn’t always the best approach in highly creative work, it isn’t even always possible.

Anyway, I hope this proves useful, there’s a couple of other solutions out there but this one feels the most processor friendly and doesn’t rely on essentially “polling” the ADDED event, or ENTER_FRAME until your on stage element appears in memory.

Note: It’s important to remember that there are bugs related to both Event.ADDED_TO_STAGE and Event.RENDER (with wmode). So best be sure your viewers are using Flash Player 9.0.115.0 or greater to avoid a world of pain :)

I recently posted on using a mobile phone’s data connection with Mac OS X, and I’ve just had some sucess with my new eee Linux based laptop, again on Vodafone (but I imagine other operators will be similar).

To dial up a connection, plug the phone in via USB and setup a new Dialup Connection in the Network Connections manager with the following information:

Phone number: *99***internet#
User name: web
Password: web

The difference here is that I’m putting the access point name in the number to dial, no doubt the script I was using on OS X was doing this for me. These settings worked on a plain vanilla eee PC without messing around in /etc/ppp. So that might vary operator to operator. Best of luck, please post in the comments if your process varied for other operators or devices.