Add webcam projects to the table.
Flash's ability to analyse bitmaps and do funky things with them is pretty poor.
Take the Java ripple effect (yes, I'm not done moaning about this).
http://viz.nu/programming/processing/splish
And convert that to Flash:
Code:
import flash.display.BitmapData;
var plane:BitmapData = BitmapData.loadBitmap("check"); // 200x200 png, linkage="check"
var map:BitmapData = new BitmapData(plane.width, plane.height);
createEmptyMovieClip("holder", 0);
holder.attachBitmap(map, 0);
// Water voodoo
var sludgefactor=6.;
var Xoffset,Yoffset;/Refraction vector
var size = 200*200;
var pt1 = new Array();//Pointer to reference heighmap
var pt2 = new Array();//Pointer to reference heighmap
var tmpt = new Array();
var border = 1;
for(var i = 0; i
pt1[i] = 0;
pt2[i] = 0;
}
holder.onEnterFrame = function(){
splash(Math.round(this._xmouse) ,Math.round(this._ymouse) , 10 ,2);
// Create splashes where mouse cursor
// The main calculation is below. We go through every pixel in the array pointed to by pt1, setting its value
// based on the previous heights stored in pt2. This can be optimized but is left as-is for readability.
for(var j=1;j
for(var i=1;i
pt1[i+j*plane.width]=0.98*((( lu(i+1, j, pt2)+ lu(i-1, j,pt2)+ lu(i, j+1, pt2)+ lu(i, j-1, pt2) )/2.0)-lu(i,j,pt1));
}
}
// Now that we have our new heightmap stored in pt1, we render the image by finding a refraction vector for
// each pixel, and grabbing the color it points to in our image.
for(var j=border;j
for(var i=border;i
Xoffset=(lu(i+1,j,pt1)+lu(i-1,j,pt1))/sludgefactor;
Yoffset=(lu(i,j+1,pt1)+lu(i,j+1,pt1))/sludgefactor;
plane.width-border || Xoffset+i
plane.height-border || Yoffset+j
//trace(Xoffset+" "+Yoffset);
//pixels[i+j*width]=P.pixels[int((i+Xoffset)+(j+Yoffset)*P.width)] ;
//Draw our pixel!
map.setPixel(i, j, plane.getPixel(i + Xoffset, j+Yoffset));
}
}
tmpt=pt2;
//Hold pt2 location
pt2=pt1;
//Switch what pointers reference, effectively
pt1=tmpt; //"copying" the current state into the previous state buffer
}
function lu(x:Number, y:Number, array:Array){
// look up a table
return(array[x+y*plane.width]);
}
function splash(x:Number, y:Number, power:Number, sqsize:Number){
//Ugly routine for creating a splash
=sqsize && x
for(var xx=-sqsize;xx
for(var yy=-sqsize;yy
pt2[((y+yy)*plane.width)+x+xx]+=power;
}
}
}
}
Mind numbingly slow.
And also sound analysis. No fft in Flash.
I generally tout the site-specific-installation benefits of processing and avoid the whole web-deployment aspect.
My 2¢