Something Wrong with the System

A Flash/Actionscript blog

pixelizer [cooler version] (.swf and source)

Ok, I came up with a slightly cooler version of the pixelizer that I posted posted a couple days ago.

This code is a little harder to follow. But on the bright side, I’ve added 3d Effects and BLUR! WOO!

Read the rest of this entry »

May 3rd, 2008 by Peter Organa

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

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