ColorWall gets half a million hits

Leave a comment 4 March 2011

So last night, while I was tucked away in bed in London, somewhere in the world (possibly even in London) someone viewed ColorWall, and little did they know they where the 500,000th unique person to see it. Madness.

I made ColorWall purely as an example of how to re-create Yugo Nakamura’s great wonderwall effect. It was really just to see if I could do it using particles rather than a 3D engine but I was so happy with the result I thought I’d post it here on FlashMonkey, along with an explanation of how I did it and some source code.

I got some nice comments here such as Sourav Bhargava’s – “great analysis man . I appreciate your work. thanx the work helped me a lot”, and I did some spin off work such as WobbleWall and ColorSnake, but eventually I moved onto the next thing and started to forget about ColorWall.

However, whilst away travelling in Latin America last year I decided to check my Google Analytics (as you do) and couldn’t believe my eyes! ColorWall was starting to get a lot of hits, one day alone it got over 20,000. A little further investigation in GA showed me that most of these hits came from StumbleUpon.com, and a fair few from other social media sites such as Twitter, Facebook and Tumblr. It seems ColorWall (not ColourWall – I’ve taken a fair bit of stick from my compatriots for spelling it the American/programming way) has entertained people in a way I never intended/expected. Although 250 of the hits came from shroomery.org so that might go some way to explaining things.

Anyway, I’ll leave you with some comments people have made on StumbleUpon, I’ll start with the nice stuff, and end with some comments from people who ‘didn’t get it’! ;)

He should check out WobbleWall

No. It’s Flash. I have done a crappy HTML5 version though: HTML5 ColorWall


Posted in ActionScript, Experiment, Physics

addFrameScript and currentLabels

3 Comments 9 February 2011

Today I’ve been setting up a very simple project – an intro animation and then some text/links fade in. The designers are making the animation and I’m just writing some basic code for the links etc (it’s CMS driven, many languages).

The client often like to change their minds (just a regular client then) and I know that the animation may change quite a bit. To fade the content in after the animation I am using addFrameScript.

However, a problem, I know the frame that the fading should take place on could change several (hundred) times before the project goes live. I could just tell the designers where in the code to change the frame number, but I thought of a nicer solution than that.

The code was a simple combo of addFrameScript and currentLabels. I got the designer to add a label on the frame they want the fading to take place and then used this simple code:

function addLabelScript(mc:MovieClip, label:String, func:Function):void
{
  var labels:Array = mc.currentLabels;
  var i:int = labels.length;
 
  while(--i > -1)
  {
    if(FrameLabel(labels[i]).name == label)
    {
      mc.addFrameScript(FrameLabel(labels[i]).frame - 1, func);
      return;
    }
  }
 
  trace("WARNING: The label '" + label + "' does not exist in the MovieClip '" + mc.name + "'");
}

OK it’s not going to make you fall off your chair with wonder but could be useful in the future. I’ve chucked it in a utils Class so it can be used like this:

function init():void
{
  Utils.addLabelScript(animation, "animation-complete", onComplete);
}

function onComplete():void
{
  trace("hello monkey I'm finished, do your fading thing");
}

In the above example the frame label the designer adds is “animation-complete”.


Posted in ActionScript, Tip

Simple image physics with HTML5 Canvas

Leave a comment 19 January 2011

I must admit that since returning from over 7 months travelling I’ve lost a little of my motivation for programming. However this afternoon at work I had a little downtime and decided to read through some of my emails and comments I’ve received on this blog for some inspiration.

One such comment I found was on my Simple JavaScript Physics post which asked about doing something similar with images. I quite enjoyed playing around with JavaScript and the canvas tag earlier in the year so thought I’d chuck something together. I still need to do collision detection but the throw physics is there. Click here to view it and as with my other JS experiments all the code can be found in the source code.


Posted in HTML5, JavaScript, Physics

Using MouseEvent.DOUBLE_CLICK in AS3

6 Comments 30 December 2010

Surprisingly I have never had a need to use the double click event in ActionScript 3.0 until this morning. I presumed it would work exactly like the single click event so at first I just used this:

item.addEventListener(MouseEvent.DOUBLE_CLICK, listener);

But nothing happened! A little look at the docs revealed why, you just need to add this line:

item.doubleClickEnabled = true;
item.addEventListener(MouseEvent.DOUBLE_CLICK, listener);

Simple.


Posted in ActionScript, Tip, Uncategorized

Flash Monkey is back!

1 Comment 30 December 2010

I’m back! After over 7 months of travelling from Mexico to Argentina (via Belize, Guatemala, Honduras, Nicaragua, Costa Rica, Panama, Colombia, Brazil, Peru and Bolivia), and a few weeks in Sydney and Thailand on the way home I am now back in London and trying to figure out how to program again. ;)

I came up with a few ideas while I was away and plan to get some new stuff up on the site in the new year so watch this space. Also I will get back to people who have sent me emails while I’ve been away.


Above: Salar de Uyuni in Bolivia – one of my favourite photos of the trip


Posted in Employment, Experiment, Physics, Site, Tip
← Older posts Newer posts →