kelvinluck.com

a stroke of luck

Actionscript 3: part 3!

Update 2:

This is a very old page imported from my previous blog. If there is missing content below or anything that doesn’t make sense then please check the page on my old blog.

Update:

These examples were created with the very first beta of actionscript 3 and run on the very first beta of the flash player 8.5. Unfortunately they don’t work on any release version of the player because of changes Macromedia/ Adobe made.

The evolution of my ActionScript 3 project has continued. Here is the current swf (remember you will need the Flash Player 8.5 to view it):


As you can see, it’s a whole heap more exciting now… It still creates the mosaic tiles from the original jpeg in the same way as the previous examples but now each tile also listens for an EventType.ENTER_FRAME event. This is basically the same as having a MovieClip.onEnterFrame event handler in older versions of Flash. Each tile is repulsed by the mouse using Barslund Repulsion (thanks to a script I grabbed from Solid Ether).

Here is the code for the example in it’s entirety:

Fairly simple really… And if anything it seems way more efficient and responsive than my attempt at bounce tweening in the last example…

Comments or suggestions for improvements appreciated :)

2 Comments, Comment or Ping

  1. Possibly add cacheAsBitmap = true in the MosaicTile constructor. That might speed it up quite a bit.

    October 31st, 2005

  2. Good point Jon… I didn’t think that would have much effect on such a simple example but just tried it and found it had a very noticable effect on my machine… Infact it changed the “feel” of the example quite alot and it seemed to lose some “fluidity”...

    Hard to explain but try it on the code above and you might see what I mean (or maybe you will see what I mean without cacheAsBitmap if your computer is faster than mine!).

    Anyway, amazing the difference it made and would definitely recommend it in situations where you were rendering bigger images than this.

    Thanks for the feedback :)

    October 31st, 2005

Reply to “Actionscript 3: part 3!”