Something Wrong with the System

A Flash/Actionscript blog

I’m not dead! I feel happy!

Hey, sorry that I’ve disappeared!

I’ve been saddled with a bunch of major projects (with deadlines!) at work and I just don’t have the strength to code all day and then go home and code some more.

I was working on an interpretation of Grant Skinner’s curved line code which was just giving me headaches. What I have so far is just a clone of what Grant’s done. Except that my math is completely different 😀 Not better mind you, just different.  I made it a point to code my version without looking at Grant’s source, I did steal his ideas though!

You can see it after the break.

Read the rest of this entry »

June 17th, 2008 by Peter Organa

Don’t Get Any Big Ideas

It’s been a while since I posted, and an even longer time since I made a non-programming post.

So. Check out this video. So geeky!
Don’t you dare fast forward! You’ll just be cheating yourself.

It’s Radiohead’s Nude played on an old Spectrum Sinclair and a whole bunch of junky (fantastic) old hardware.

I found this via Boing Boing Gadgets

And yes, I’m planning a new AS3 project. But I need
A) An idea.
B) Time! Work has been crazy this week and I’m kind of exhausted.

Grant Skinner kinda sorta challenged me to re-do my Angry Red Tick with better code, so I may very well get started on that this weekend.

June 6th, 2008 by Peter Organa
Posted in Not Programming | Comments Off on Don’t Get Any Big Ideas

flipBoard Version 1.0 (swf and Source)

Alright, here it is flipBoard Ver. 1.0!

This is an animated picture transition engine written in AS3 which uses as3flickrlib to connect to Flickr to pull images in real time.

I realized that the panels in the previous version were far too small and far too fast. Giving the impression that the panels were just kind of shimmering rather than actually flipping. This version has much larger and slower panels.

I’ve also added title and author support!

Another new feature is skipping images: If you click on the image you can force it to go to the next image without waiting for the timer. I’ve added a new transition style (circular) for these forced swaps.

After the break I’ll show off the working swf, I’ll give a link to the source code and I’ll describe how to use the application.

I’ve also included a bare bones example of my as3flickrlib implementation.

Read the rest of this entry »

June 2nd, 2008 by Peter Organa

Pixel Board using as3flickrlib (SWF in progress)

I’m still working on this one, but I think I’ve made enough progress that I can show it off in its current state.

This AS3 app is pulling images from Flickr using as3flickrlib and displaying them in an animated pixel board.
Read the rest of this entry »

May 31st, 2008 by Peter Organa
Posted in AS3, Programming | Comments Off on Pixel Board using as3flickrlib (SWF in progress)

Zoom In/Out Image viewer (.swf & source)

First of all, I made it to ten posts! W00, I really wasn’t sure if I’d make it this far.

Recently at work, I had to write an AS3 image viewer with zoom and pan capabilities. It was a lot harder than I had anticipated. I decided to write another (much better) version for the blog. I’m hoping that by releasing this code I’m saving a couple people a lot of grief.

You can zoom in/out with the buttons in the bottom right corner, or by using your mouse wheel (Mouse wheel might not work on a Mac! Let me know if it’s an issue or if you have a solution).

After the break you can see the application in action.

I’ll also try to explain some of the ActionScript parts I found interesting.

Read the rest of this entry »

May 18th, 2008 by Peter Organa

Colour Seperator (.swf and source)

Update May 27, 2008: Hey guys I just found a much better way of doing colour separation. The code below takes a very brute force approach. It seems the Flash engineers were one step ahead of me though. There’s a method called copyChannel() which essentially takes a selected colour channel from one bitmap and moves it into another. The below code is still a decent introduction to parsing through bitmaps and bitwise operators. It’s just not the efficient way to do this task.

After the Red tick failure this morning, I wanted to get right back into it and do something quick.

In this project I:

A) Load in an external image

B) Read in all of the image’s pixel values and split the data in to red, green, blue.

C) Feed the colour data into seperate layers

D) Animate ’em!

I’ll go into the code after the break.

But first:

I stumbled upon this link while looking into bitwise operators:

Bitwise gems

It’s a great resource and I’d strongly suggest looking into it, especially if you’re not familiar with getting colour data out of hex numbers.

Read the rest of this entry »

May 12th, 2008 by Peter Organa
Posted in AS3, Programming, Source Code | Comments Off on Colour Seperator (.swf and source)

Angry red tick (.swf)

Angry Red TickSo first of all I’m not dead! I haven’t given up on blogging, experimentation or coding.

But I did run in a completely wrong direction with my latest experiment. This is actually a bit of an epic failure. It’s SUPER slow, doesn’t look great… meh.

But I did some cool stuff with colour transitions and the tentacles are kind of cool.

So check out the full post to see the working swf, my apologies if it’s really slow on your computer 😀

No source this time guys, it’s just too much of a mess.

Read the rest of this entry »

May 12th, 2008 by Peter Organa

The Forever Tree (.swf) update: (& source)

Ok, this was a totally accidental project. I was planning on doing a GSkinner style branching tree, and ended up with something kind of cooler.

Here’s an image from the app:

foreverTree image
Click to see it in action

I’m especially happy with the seeded random code, it’s based off of the perlin noise function.

I’ll probably post the source code early next week. But right now it’s time for Team Fortress 2!

UPDATE:
Just finished playing, so I can go ahead and post the source. This one is more messy than usual.
Click to Download Source

May 4th, 2008 by Peter Organa

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