I’m a webdesigner, and not so good at code. I was inspired by Neaves Imagination script.
Code: http://code.google.com/p/neave/downloads/detail?name=neave_imagination.zip
Example: http://www.neave.com/imagination/
I’m trying to implement it as an ambient illustration in a site, but I want it to either run with a transparent background, or i’ll have to scale a one pixel wide gradient PNG that is the site background below as the canvass background.
Because of the advanced actionscript nothing I know works, and I’m a code hacker-arounder not a programmer. I think I have it isolated to line 20 of NeaveImagination.as but I don’t know what to do. I have tried changing:
bmp = new Bitmap(new BitmapData(sw2, sh2, false, 0x00000000));
and
blackBitmap = new BitmapData(sw2, sh2, false, 0xFFFFFFFF);
by playing with the first two digits of the hex which I read might affect transparency, I also tried removing this function, and various other things you might expect an actionscript-idiot-css-writer to try.
/**
* Sets up the main bitmap
*/
private function initBitmap():void
{
// Stage sizes
var sw:int = stage.stageWidth;
var sh:int = stage.stageHeight;
var sw2:int = Math.ceil(sw / 2);
var sh2:int = Math.ceil(sh / 2);
// Create the main bitmap to draw into (and half the size to run faster)
bmp = new Bitmap(new BitmapData(sw2, sh2, false, 0x00000000));
bmp.smoothing = true;
bmp.scaleX = bmp.scaleY = 2;
bmp.x = (canvasWidth - sw) / 2;
bmp.y = (canvasHeight - sh) / 2;
container.addChild(bmp);
// Create bitmap data for fading into black
blackBitmap = new BitmapData(sw2, sh2, false, 0xFFFFFFFF);
//blackBitmap =
// Bitmap is moved over into position then halved in size to run faster
m = new Matrix();
m.translate(-bmp.x, -bmp.y);
m.scale(0.5, 0.5);
// Origin and blur filter
p = new Point(0, 0);
blur = new BlurFilter(4, 4, 1);
}
Can anyone point me in the right direction?:hat: