Something Wrong with the System

A Flash/Actionscript blog

Pixelizer (.swf and source)

Ok, new project!
This took a few hours to get going, largely because I did the ball spin animation and scrollbar from scratch. Hopefully I’ll reuse them!

You can pretty much ignore every class in this project except: pixelEngine
That’s where the magic happens!

public function setBitmapSize(newScale:Number) {
var newBitmapWidth:Number = maxBitmapWidth / newScale;
var newBitmapHeight:Number = maxBitmapHeight / newScale;
//
myBitmapData = new BitmapData(newBitmapWidth, newBitmapHeight, false, 0x000000);
//
var bitmapScale:Number = 1 / newScale;
myMatrix = new Matrix();
myMatrix.scale(bitmapScale, bitmapScale);
//
myBitmapData.draw(mySource, myMatrix);
myBitmap = new Bitmap(myBitmapData);
myBitmap.width = maxBitmapWidth;
myBitmap.height = maxBitmapHeight;
...
}

Here are the fundamentals:

  1. Figure out the size of your new bitmapData by dividing the maximum size by your reduction value. So if you’re doing a 4x reduction and your fullsize image is 200 pixels: 200 / 4 = 50 pixels.
  2. Create a matrix and change it’s scale. This will squeeze the captured image into the reduced space of the new bitmapData
  3. Draw the source data into your bitmapData, make sure to include the Matrix.
  4. Stretch your new small bitmap to fill the screen

That’s it! The rest of the code is there as support structure.

Click to see the finished project and download the source.

Read the rest of this entry »

April 29th, 2008 by Peter Organa

Something Wrong with the System

Something Wrong with the System

I think I’m going to leave the blog title as “Something Wrong with the System”.

A few weeks ago I saw this sign up at a Tim Hortons.

It was just too unintentionally subversive to be ignored!

So now you know!

Update: The sign reads,
“Tim Card –
Master card not working –
(something wrong
with the system)”

At which point I said “F-YAH! THERE IS SOMETHING WRONG WITH THE SYSTEM”

Oh and thanks to Erin for taking the picture!

April 29th, 2008 by Peter Organa

pixelStorm ver.2 (.swf with Source)

Ok, my first AS3 post.

This week I went to FITC. I had a really good time, I went to a bunch of really interesting sessions, got drunk at the open bar and hung out with Grant Skinner for a while. Good times.

The important thing I learned from FITC is that: A) I should do more experimental work B) I have to start a blog so I can share my work with others.

So, here it is. My first post-FITC AS3 code post! I call it pixelStorm (sounds like a straight to VHS movie circa Lawn Mower Man)

I got the idea from GMUNK’s session: He mentioned a rejected project where words would appear on screen one pixel at a time.

Click to see the swf and download the source.

Read the rest of this entry »

April 27th, 2008 by admin

First post! w00!

Well, I’ve decided to step up and participate in the whole uh… ‘blog-o-sphere’ thing.

I’m hoping to use this space to publish some ActionScript3 source code. Maybe I’ll post some thoughts on… you know… topics and stuff.

So, non-existent reader. Be patient, I have no idea what I’m doing.

April 27th, 2008 by admin