Drugfucked

drugfucked

Fun little (ahem) viral project for the Terrence Higgins Trust to promote awareness in HIV+ gay clubbers who indulge in recreational drugs as to their effect on whatever HIV meds they may be taking.

http://drugfucked.tht.org.uk/

Another AS3 project - all a bit hack and slash, though, as time was limited and the focus was on getting the best result with the resources available.

Papervision3D - first steps

Finally got some down time here at work and figured I’d have a poke around in this Papervision stuff.

Have always managed to stave off working with 3D in the past, but from what I’d seen of it, Papervision looked like it had made the whole process a hell of a lot simpler and more manageable.

Found a few really good resources and did a few demos:

(click card to flip)

Need to find an excuse to do a site with it now :)

Sony GT5 Prologue

GT5 Prologue

Just a note to mention so recent work for the Sony GT5 Prologue game.

http://www.granturismoworld.com/

Nothing too special about this project. There’s some nice, balanced HTML/Flash integration demonstrated in the expanding flash menu that sits over the other HTML/Flash main content.

One nice feature is a Local Connection controlled auto-pause of the in-page videos whenever the flash menu is opened - and subsequent resume when it closes. The idea revolves around a satellite and controller system - the in-page videos register themselves with the menu (the controller) and then listen for events from the menu.

UINT

Found a nice way to use uints' default value to my advantage. Have started using them for all my identifier constants in my apps. As they default to 0 (zero) even when uninitialised, as long as I make sure all my constants have a minimum value of 1, all I need to do is set up a global NULL constant of 0 and compare any class properties to that.
I can test properties regardless whether they've been initialised or not, so no more looking for nulls or empty strings, etc.

Actionscript:
  1. public static const NULL:uint = 0;
  2. public static const STATE_LOADING:uint = 1;
  3. public static const STATE_LOADED:uint = 2;
  4. public var state:uint;
  5. //check state before it has been set:
  6. trace( state == NULL ); // true - not inititalised

Dynamic font loading in AS3

Always a particularly uncomfortable stone in actionscript's boot, dynamically loading fonts at runtime has always been difficult. Many of my projects in the past have used library fonts as runtime shared libraries from the standpoint that once downloaded, it'll be available across projects. It was never the cleanest of solutions and besides, the entire font had to be loaded - no choosing which character sets to embed, it was all or nothing.

This didn't solve the problem of catering to markets that required special fonts that supported either greek or east asian character sets. I once got round the problem with one of our jaguar sites by an elaborate level loading process that I forget now and probably couldn't explain any more :) .

Enter AS3 and the magical getDefinitionByName() method. With it, you can retrieve and instantiate classes as long as you know their fully qualified class names. Yes - even from loaded SWFs.

From there, all you need do is embed a font (explicitly specifying the unicode ranges of character outlines that you want) into a class inside a SWF, load that swf at run-time and extract the font from it. Add it to your main SWF's fontlist and it's instantly available to use!

Granted, I may have simplified my description a tad, but those are the essentials. In my latest AS3 project, my initial setup loads a config XML file, a localised copy file, a CSS styles file and a handfull of fonts needed to render the text within the app. Should I need to configure the application for the Japanese market for example, I can completely reconfigure the app and it's fonts to support the Japanese characters without republishing.

Now that's how it's supposed to be!!

Check these articles out for a more detailed explanation:

http://www.betriebsraum.de/...runtime-font-loading-with-as3/
http://www.mikechambers.com/...class-reference-by-class-name/
http://www.scottgmorgan.com/...runtime-font-embedding-in-as3/

Ped’s back!

An old friend of mine that i basically learned flash with - who had given up the coding life - recently emailed me to let me know that he was getting back into Flash (and AS3).
We were hacking code out back in the days when the flash world was rejoicing at being able to enter free-text code into the actions panel for the first time and emulating the new-fangled 'event-driven' stuff was the latest thing :) . He 'got out' just before AS2 really kicked in, so essentially he now has to make the leap from AS1 all the way to AS3. That's gotta be more than just a minor shock to the system!

Anyway, good to have you back, fella! Look forward to seeing what you get up to :)

Jaguar XF: Extreme Fatigue

tired_small.jpgSometimes you climb a mountain and, weary from the effort, you stand up and take a good long look around. You soak up the view and, feeling exhausted but re-invigorated, you stand back and really appreciate your achievement.

I’d like to echo the sentiments above, but I’d just really like a few days to get to know my duvet again – possibly with some pottering around the house, catching up on some lapsed TV series, maybe even deflowering the copy of God Of War II that still remains untouched next to my dusty PS2. You never know, I may even go outside… drink alcohol… see this summer thing that everyone’s on about…

Bit of a monumental project, this one; the microsite for the new Jaguar XF - no less for the fact that three generations of the Global Beach Flash team were involved in the project.

In fact this project saw the majority of our senior agency staff pull together to bring this beast to life.
And quite a beautiful beast it is:

http://www.jaguarxf.com/

Flash Peek Bookmarklet

A little trick I've picked up along the way is to enter Javascript directly into the address bar in order to peek at variables inside a running flash movie.

Well I got bored of always having to specify the name/id of the flash movie and having to re-type variable paths in, so i wrote a bookmarklet that identifies the first flash movie on the page, prompts you to enter the variable name you want to see and also retains your last entry in a cookie.

Just open the link below, copy the Javascript (making sure to remove any linebreaks) and create a link in your browser's links toolbar. Paste the javascript as the URL (ignoring any warnings) and then click it when viewing a page that contains a flash movie.

View Javascript

Bentley Continental GT Convertible

Bentley CGTC Homepage

View the Bentley Continental GT Convertible Microsite

Yet another tight deadline for this one. I think it topped out at around 3 weeks' dev time on this. :) Completely content managed and data driven, this site featured a fair amount of ported code from the Bentley 60Yr Microsite as rewriting from scratch would simply have been impossible in the time given.

This kind of situation really brings home the value of code reusability and writing clean, modular class structures that provide flexibility and the option to slot them into different scenarios. I probably saved my own bacon on this occasion simply by putting a little forward thinking into some of my classes.

The CGTC site was another microsite, but I'm finding microsites are getting bigger and bigger. There are a hell of a lot of corporate sites out there that feature less sections, information and complexity than the majority of the 'microsites' that are released these days. I just hope the price of these things is growing proportionally :) .

(more...)

Bentley 60Yr Microsite

Bentley Sixty Homepage

View the Bentley 60Year Celebrations Microsite

Towards the start of 2006, my company began working with Bentley Motors and it fell to me to develop their first Global Beach content - a flash microsite celebrating 60yrs of motor cars design and development in Crewe.
Due to quite a short deadline, parts of the site had to be timeline based instead of our usual, scripted approach. It's always quite annoying having to integrate designer created flash into your app - movieclips not being top-left aligned, scaled or just simple unnamed. It's mainly just a case of looking at the component parts of the design and seeing how much easier it would be to create and control the layout/animation through pure code. It just takes a little longer sometimes :(
(more...)