Diesel Island FW11

Diesel Island FW11 is an interactive video showcase of the clothing Diesel would like you to be wearing as the year draws to a close.

Read the rest of this entry »

Tags: , , , ,

Hugo Just Different – Kino

Kino for Hugo Just Different is all about seeing things differently. An interactive film directed by Marco Brambilla allows people to explore five different scenes through the shades of Theatrical, Performance and Story, simply by tilting their heads from side to side. The webcam monitors the tilt position of the head, which in turn invokes seamless transitions from one intricately gorgeous environment to another.

Read the rest of this entry »

Tags: , , ,

CompareTheMeerkat.com – Meerkovo

Everyone’s favourite Meerkat, Aleksandr Orlov, is back and this time he’s with a bunch of his friends – the whole village of Meerkovo, in fact. Meerkovo.com allows fans to engage and interact with one of the richest back stories in recent UK advertising.

Aleksandr's Mansion

Aleksandr welcomes you to his Mansion. Feel free to explore all of his meerkat oddities via the comfort of your own komputamabob. Simples!

Read the rest of this entry »

Tags: , , ,

Tips for building AIR for Android Mobile Apps

There were a lot of learnings in building CrossTweet for Android. Here are a few tips I’d like to share with you.

Adobe AIR for Android

Read the rest of this entry »

Tags: , ,

CrossTweet: Where digital and everyday life intersect

During my last few days working at Blue Barracuda, I managed to find a little R&D time. The result of which has been an experimental interactive data visualisation piece known as CrossTweet.

CrossTweet

Read the rest of this entry »

Tags: , , , ,

Regex to find non-weak referenced addEventListener()

It’s always advisable to use weakly referenced event listeners in AS3. If you need to recap on why, check out Grant Skinner’s blog post. But in practice, if you’re ‘coding at the speed of thought’, or if you’ve inherited someone else’s code base, you may end up with some calls to addEventListener() which don’t use a weak reference.

The following regular expression will find all occurrences of addEventListener() that don’t use a weak reference:

1
addEventListener( *)\([a-zA-Z._ ]*,[a-zA-Z._ ]*\)

Using this with your code editor’s “Find in Files…” feature (ensure you check the “Use Regular Expression” option) will track down each offending code snippet, which you can then manually amend should you decide that using a weak reference is suitable.

FDT search regex to find non-weak referenced addEventListener code

Example of using the regular expression in the FDT "File Search" dialogue

Just make sure that you’re not relying on the reference created by addEventListener() to prevent the garbage collector from devouring your object for dinner. Generally, using a weak reference is fine when adding an event listener to a class scoped object, but not to an object locally defined within your current method.

Feel free to test/demo/fork it at http://regexr.com?2s5fc

Tags: , ,

The Girl Who Played With Fire

I’ve got Facebook games coming out of my ears right about now! This one is to accompany the new movie ‘The Girl Who Played With Fire’ – out in cinemas later this month.

Play: The Girl Who Played With Fire

Ooh! Looks like I got one right =)

Read the rest of this entry »

Tags: , , ,

Pizza Hut – Hungry For ‘A-Team’ Action

Hot on the heels of ‘Pass It Around Pizza’ comes ‘Hungry For Action’; the second social game for Pizza Hut UK. Supporting the release of the new A-Team movie, the premise is simple; smack the living daylights out of as many soldiers as possible.

We were originally going to create a brash tank-based game, until we realised that'd probably turn more women (being a large wedge of our target demographic) off than John McCririck's sweaty wackers on a humid summer's evening.

Read the rest of this entry »

Tags: , , , ,

AS3 Vector shuffle / randomize

UPDATE: Please see comments below for a shuffle technique using the efficient Fisher-Yates algorithm.

Whilst working on an AS3 project, I figured I needed to shuffle the order of a Vector. A quick Google search looking for a code snippet that will shuffle the order of an Array will produce many results (although I’d most likely use the nicely packaged CasaLib’s ArrayUtil.randomize()). But the same is not true (at least as of writing) for shuffling the order of a Vector.

So this post is for anyone stumbling on in from Google, requiring a quick “I can’t be bothered to think about it” solution:

1
2
3
4
5
6
7
8
9
10
11
function shuffleVector( a:Object, b:Object ):int
{
        return Math.floor( Math.random() * 3 - 1 );
}

// Some quick timeline code to test it
var v:Vector.<String> = new Vector.<String>();
v.push('one', 'two', 'three', 'four');
trace( v );    // Original
v.sort( shuffleVector );
trace( v );    // Shuffled

Just to note, Array.sort() has never won any awards for code execution speed, so it’s likely that Vector.sort() won’t either.

Tags:

Wagamama Keepy-Uppy

In the spirit of the World Cup 2010, Wagamama wanted to challenge their loyal fans, old and new, to a classic game of football keepy-uppy — but not without a twist.

Hit it, spin it, whack it against the wall — most importantly, keep it up!*

Read the rest of this entry »

Tags: , , , ,

Pass It Around Pizza

UPDATE: Read my “Pass It Around Pizza” article on the Blue Barracuda blog. Aimed at marketers, it looks at the benefits of using in-game incentives/virtual gifts and rewards in conjunction with the Facebook Platform.

I’ve been getting to know Facebook Connect and the AS3 API over the past few weeks, and finally I’ve been able to put what I’ve learnt into practice by creating a game for Pizza Hut UK.

Pass the ball as many times as you can in 45 seconds!

Read the rest of this entry »

Tags: , , , ,

Facebook Multi-Friend-Selector for Flash AS3

UPDATE Nov 2010: This requires the old REST API Facebook_library_v3.4_flash.swc, which has now been deprecated in favour of the Graph API. Please feel free to fork this for use with the new GraphAPI SWC. There is a little more info on this in the comments. I’d love to update it myself, but not sure when that might happen at the moment :-/

One of the drawbacks of the current Facebook Actionscript API is that it doesn’t come bundled with UI components, it’s simply a data API. Fortunately you can use the JavaScript Client Library’s FB.UI.FBMLPopupDialog() to render FBML overlaying your SWF (if you don’t mind using wmode=”transparent”). But still, when it comes to the FBML fb:multi-friend-selector, if you want to do anything but send out invites to your Facebook app (via a browser-redirecting POST) , you’re out of luck.

Ideally, the fb:multi-friend-selector would allow the setting of a callback which would return the UIDs of the selected friends. It would then be down to the developer to choose what to do with them.

So, I decided to recreate the fb:multi-friend-selector directly in Flash. It will allow you to input an array of uid strings and later return a FacebookUserCollection featuring the selected users. Unfortunately I haven’t created this to be a fully resizable component, it simply does what it says on the tin. Hopefully, you may find that this gets you out of a sticky situation once you realise the shortcomings of the FBML fb:multi-friend-selector.

Don't be fooled, this MultiFriendSelector is not FBML, it's Flash :)

You can download it from the milkisevil-toolbox on github. You’ll need to add the “lib/milkisevil/FacebookComponents.swc” to your project and create a new instance of the “com.milkisevil.ui.facebook.MultiFriendSelector” class.

Here’s a rough guide to how you might want to instantiate the MultiFriendSelector:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Don't forget to make the following imports where appropriate
import com.milkisevil.ui.facebook.MultiFriendSelector;
import com.milkisevil.events.StatusEventEnhanced;

// And the following inside your class
private var multiFriendSelector:MultiFriendSelector;

private function showFriendSelector():void
{
    multiFriendSelector = new MultiFriendSelector( facebook, 16 );
    multiFriendSelector.title = 'Your friends';
    multiFriendSelector.subtitle = 'Irritate the hell out of your friends!';
    multiFriendSelector.addEventListener( MultiFriendSelector.STATUS_EVENT, multiFriendSelectorStatus );
    addChild( multiFriendSelector );
    multiFriendSelector.getFriends();      
}

private function hideFriendSelector():void
{
    removeChild( multiFriendSelector );
    multiFriendSelector = null;
}

private function multiFriendSelectorStatus(event:StatusEventEnhanced):void
{
    trace('exec multiFriendSelectorStatus: ' + event.code);

    switch(event.code)
    {
        case MultiFriendSelector.CLOSE:
            hideFriendSelector();
            break;
       
        case MultiFriendSelector.SUBMIT:
            var selectedUsers:FacebookUserCollection = multiFriendSelector.getSelected();
            hideFriendSelector();
           
            var uidList:Array = [];
           
            for(var i:int = 0; i<selectedUsers.length; i++)
            {
                var facebookUser:FacebookUser = selectedUsers.getItemAt(i) as FacebookUser;
                uidList.push( facebookUser.uid );
            }
           
            // Now do some custom stuff with those uids
            myCustomMethod( uidList );
           
            break;
    }
}

Tags: ,

Going social in Actionscript 3

The last couple of weeks have allowed me to get intimate with AS3 implementations of the main social network’s APIs. I first started out playing with Adobe’s Flash Platform Social Services which is basically a layer providing access to Gigya (which in turn is an abstract API providing uniform access to all of the main social networks). As you can probably imagine, this also comes with a couple of drawbacks.

  1. Gigya aims to provide the ‘make one call, push to many’ approach. This is one of the reasons that the full spectrum of services for one social network aren’t available, largely because there won’t be a uniform equivilant on another network.
  2. The other reason, is that we’re relying on a single API vendor (Gigya) to update as and when every other API vendor updates. So where a great new service might be made available on Facebook, you’ll likely be waiting a while until Gigya provides an updated interface.

Not great. So putting aside a greed to support every social network under the sun, I swiftly moved to and focused on the the most popular (and arguably the best), the Facebook Actionscript API. This is basically an Adobe supported AS3 interface to Facebook’s REST API. The majority of it is very straight forward to use, and is up to date with the latest of Facebook’s features. The biggest pain, though, has been offering a smooth login experience.

There are several blogged solutions out there, but the smoothest I’ve found revolves around using the JavaScript API in conjunction with an “xd_receiver.htm”. The user logs into their account after which a JavaScript callback passes a session key, a secret key, the user’s UID and your (hardcoded) API key to Actionscript where it is verified via the REST API. This does require a bit of a hack seeing as the AS3 API doesn’t normally allow the setting of the UID, but I’d say it’s worth the trouble:

1
2
3
4
5
6
7
8
import com.facebook.facebook_internal;

// Create a WebSession passing in your API key, the secret key and session key
webSession = new WebSession( apiKey, secret, sessionKey );

// Force set the uid (don't forget to import the "facebook_internal" namespace)
webSession.facebook_internal::_uid = uid;
facebook.startSession( webSession );

This solution will use those nice AJAX-populated dialogue boxes, so don’t forget to set wmode=”transparent” on your embed.

I’ve created a singleton-based wrapper, which provides me with easy access to basic functionality such as login and stream publishing, along with an accompanying JavaScript file (I’ve been accessing this via a PureMVC proxy – abstraction overkill?! Maybe!). It’s not exactly the tidiest of classes, but is fairly descriptive along with some doc-blocks. Feel free to download a zip here or grab the latest source from within the milkisevil-toolbox on github (you’ll mainly be interested in the api.facebook package as well as the js and possibly html test page).

Of course, you’ll also be needing the Facebook Actionscript 3 API (and SWFObject if you’d like to play with the test html page).

Tags: , ,

TGI Friday’s Cocktails

I’ve just completed a new site to promote Cocktails at TGI Friday’s. The idea is to let customers experience the essence of their cocktails, rather than simply reading a tabular listing of thumbnails & text.

Read the rest of this entry »

Tags: , ,

Connected to British Film and TV

My first major project at Blue Barracuda has gone live. Connected To British Film and TV is intended to increase people’s appreciation for the British Film and Television scene, ultimately in the hope that people will realise the error of their ways (and in future watch via legal means). It’s from the same folks who brought us those “You Wouldn’t Steal a Handbag” ads, but now instead of making people feel like criminals, the strategy is to incite national pride.

Read the rest of this entry »

Tags: , , , , , ,

Adopt an emoticon aka “Adopticon”

It’s been just over 9 years, but I figured it was time to breathe new life into an old project. What is now known as “adopticon” started life as the “emoticon generator”. It was an experiemntal pet project created for typographic56 magazine at my very first digital advertising job at Deepend way back in 2000.

adopticon - donate a little emotion

Read the rest of this entry »

Tags: , , ,

Tweet Coding

For the sake of something called “tweet coding”, I’ve finally signed up to twitter! It’s only recently that twitter was unblocked here in Dubai, as for some reason the powers that be believe it is a tool designed for the propagation of evil – either that, or Sheikh Mo just doesn’t quite understand it yet (another reason I’m glad to be leaving Dubai soon). Anyway, now twitter is unblocked, this seems to be a great reason to join.

So what is tweetcoding? Well, Grant Skinner figured that instead of holding a more traditional 1k or 20 line coding contest, let’s see what the Flash community can come up with when there are only 140 characters up for grabs. Fortunately, the rules state that the 140 characters need to be within the following code construct:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
g=graphics;
mt=g.moveTo;
lt=g.lineTo;
ls=g.lineStyle;
m=Math;
r=m.random;
s=m.sin;
i=0;
o={};
function f(e)
{
    // add 140 character code here
}
addEventListener("enterFrame",f);

So I thought I’d post my entries:

Webcam Flower

See the tweetcode: http://twitter.com/milkisevil/status/1285274918

Euro-disco-party-crazytime inducer

See the tweecode: http://twitter.com/milkisevil/status/1287552709

Tags: , ,