Casting to Array in ActionScript 2

Imagine you have: var my2dArray:Array = new Array(); my2dArray.push ([1,2,3,4,5]); my2dArray.push ([6,7,8,9,0]); And now you want to access and cast an element of myArray to an array: var firstArray:Array = Array (my2dArray[0]); trace (firstArray.length); Right?

Wrapping function calls in ActionScript 2

Also known as: debugging function calls displaying the name of a called function tracing function calls director like Today I finally got to try something I had been wanting to try for a long time: wrapping function calls in a nice way. I had been playing around with function pointers etc, which was ok in […]

Drawing using controlpoints

There is an old trick which comes down to drawing a fluid line through controlpoints, by using the average of the controlpoints as anchors. Here is my quick and dirty go at it: You can download the example here:

arguments.callee._name in ActionScript 2

A question on the flashcoders list about an hour ago triggered me to put together a very simple example that I have been wanting to put together for ages now. How do you get the name of a function? With function we could refer to: any function a calling function a function being called My […]

AsSetPropFlags Explained

You might stop reading here, everything you need to know is in the provided example:. So you have decided to read on. Yes, it’s 2007 & I’m still doing AS2. I know, it’s sad, and I’m never gonna get my band started (weird purple tentacle sucking noises). But believe or not, I still love it […]

Image flipping

A post on the flashcoderlist ( asking about an image turn around effect got me coding for 2 hours in a row until I finished it and realized my effect was not quite similar to what was required ( Anyway I liked it nonetheless so posting it anyway: You can download this example here (Flash […]

Calculating displacement maps based on reference maps

I already blogged about this, but I saw that some items could use some more explanation. Please read “Getting the displacement you need” first for the basic idea. In short the principle is: you have a reference map, say A you apply a distortion effect to the reference map created a distorted version of A […]

Panoramic projection using displacement mapping

In this post we will be looking at the creation of a distorted panorama using a displacement map. The two examples below show the difference between a panorama without and with distortion (notice how in the distorted version the grid bends): Panorama without distortion ()     Panorama with distortion ()     Some simple […]

Getting the displacement you need in ActionScript 2

In my previous post I explained the basics of displacement mapping, and I promised to tell something about getting the filter to do what you want it to do. Well, in order to do so, let’s look at the picture I showed you again, written a little differently: + *? = where ? is an […]

Displacement maps basics

I was working on the Bitmap API and the Displacement map filter and although there was some info available on it, it takes some time to get it to do what you want. Basically a Displacement map is a BitmapFilter, in other words: it moves around pixels. If you would take a source image and […]