Archive for May, 2008

Don’t shake these drawings too vigorously

30th May

2008

Everyone has owned an Etch A Sketch at some point. If, like me, you managed to draw little more than a misshapen stick man, you’re sure to be impressed by the handiwork of “artists” etchasketchist and Etcha.

Muqtada Al-Sadr
Etch A Sketch Muqtada Al Sadr

Neil Diamond (yeah right….)
Etch A Sketch Neil Diamond

Golden Gate Bridge, San Francisco
Etch A Sketch Golden Gate Bridge

Elephant with an afro
Etch A Sketch Porn

Lambie-Nairn website relaunch

30th May

2008

This week sees the relaunch of Lambie-Nairn’s brand identity, and Include has helped out by creating a spanking new website.

The focus of the home page is an innovative 3D project showcase that encourages users to click through and view in-depth case studies articles.

View the site at www.lambie-nairn.com.

Lambie Nairn Carousel-2

Wrestlebots

29th May

2008

Robots - from Metal Mickey to the Smash fellas, they’re always top-notch entertainment. Not unlike wrestling, which, at it’s best, is more thrilling than crisps. What on earth would happen if you combine the two, robots and wrestling? Witness the fitness!

Downing Street embraces YouTube

29th May

2008

The official Downing Street YouTube Channel encourages visitors to post video questions to the Prime Minister. Big Gordon has promised on his nan’s eyes that he’ll respond to the most popular questions at the end of June.

I’d like to ask him why he married Geoff Capes…

Gordon Brown

Bye bye Jimmy

29th May

2008

Hammond-hero Jimmy McGriff’s funky fingers have departed this earth. He lay down some proper nasties in his career, and, forgiving a couple of dubious covers for which he’s forgiven, his discography tastes sublime.

High fives big man, keep hitting those ivories in the sky.

Jimmy Mcgriff

Meet Adobe Illustrator

28th May

2008

With Adobe due to release the CS4 software suite sometime in the near future, I thought a trip down memory lane would be a good idea and found a link to the original demonstration video (recorded on VHS) for Adobe Illustrator 1.0.

200805281419

Developers, get ready for IE 8

27th May

2008

Microsoft is urging developers to tag websites in preparation for the release of IE 8.

According to a post made on an MSDN blog, a public beta of IE 8 will be available in the third quarter of 2008 and it threatens to “render content in its most standards-compliant way by default”. As this is the first time Microsoft has stooped to such murky depths, we are warned that this will play havoc with content written for IE 7. The advice: to implement a specially created meta tag instructing IE 8 to render the content as if it were IE 7.

This is all a lot of fun, I’m sure you’ll agree, and it does seem to offer a pretty straight-forward solution for achieving backwards compatibility. However, given that the two rendering engines are so markedly different, the most excitement will surely be reserved for the future hours spent hacking IE 8 content to display correctly in IE 7. I, for one, can’t wait for that.

Bonzo Dog Doo-Dah Band on YouTube

26th May

2008

There’s lots of rubbish on YouTube, but every now and then you stumble across something that reminds you of its value:

AMFPHP 1.9 and AS3 - Class mapping

22nd May

2008

By default, any custom class instances that are passed to a PHP method via AMFPHP are treated as associative arrays. Correct class mapping is essential if we want our PHP files to treat arguments as instances of a particular class.

You can download the sample files for this tutorial here. An introduction to AMFPHP 1.9 and Flash/AS3 is available here.

So class mapping is the process by which AS3 classes are associated with their server-side equivalents in PHP. It is actually remarkably easy to implement, although online information for AS3 implementations is rather scarce on the ground. All we really need is the flash.net.registerClassAlias class.

First, a description of the contents of the sample zip file. There are three directories:

classes - contains the document class specified in the FLA
deploy - this is the publish directory specified in the publish settings of Application.fla
fla - contains the FLA file with ‘../classes’ added to the classpath

The files are all commented, so take a look through each one to get an idea of what’s going on. The key to successful class mapping is the registration of Flash’s PersonVo class to the “vo.PersonVO” PHP class in the Application constructor.

Here are the steps you should follow to get the sample files up and running:

  1. Extract the files to a directory on your computer (they don’t need to be on a webserver to run through the Flash IDE, but it will make step 2 easier if they are)
  2. Modify the $servicesPath and $voPath variables in globals.php (in the root of your AMFPHP installation directory) with the path to the extracted ‘deploy/services/’ directory, ensuring the trailing slash is present
  3. Open Application.as and make sure the private ‘_gateway’ property is set to the location of the gateway.php file in your AMFPHP installation
  4. Open Application.fla in Flash and publish!

Clicking the ‘Register’ button creates a PersonVO object in Flash which is populated with the contents of the TextInput instances on stage and sends this to the specified service (PersonService.registerPerson). Here’s a screenshot of the sample file once the ‘Register’ button has been clicked:

Class Mapping demo

In a real world situation, the registerPerson() PHP method would process the user data, probably adding the information to a database. In this example, for the sake of simplicity, we demonstrate the fact that the passed $person parameter is of type PersonVO by referencing a property of the class instance - $person->firstname is appended with the string “(Modified by PHP)”. We can also call methods on our PersonVO object, as demonstrated by the call to incrementAge() which adds 1 to the instance’s age property. The instance is then returned by registerPerson(), resulting in the modified PersonVO object being passed back to Flash.

Once a server response is received, the Responder’s onResult() handler displays text in the ‘result’ TextArea. By casting the received object to PersonVO, we can access all the typed properties of the PHP modified object. Notice the ‘firstname’ and ‘age’ properties contain the PHP modified content.

Download source files - class_mapping_demo.zip.