# Trouble with transparency in Neaves Imagination example

**URL:** <https://forum.kirupa.com/t/trouble-with-transparency-in-neaves-imagination-example/263947>\
**Category:** flash\
**Created:** [June 20, 2008, 7:59pm UTC](https://forum.kirupa.com/t/trouble-with-transparency-in-neaves-imagination-example/263947 "2008-06-20T19:59:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferrer](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@ferrer](https://forum.kirupa.com/u/ferrer)\
**Post date:** [June 20, 2008, 7:59pm UTC](https://forum.kirupa.com/t/trouble-with-transparency-in-neaves-imagination-example/263947/1 "2008-06-20T19:59:56Z")

</div>

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](http://code.google.com/p/neave/downloads/detail?name=neave_imagination.zip)

Example: [http://www.neave.com/imagination/](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:

```auto
bmp = new Bitmap(new BitmapData(sw2, sh2, false, 0x00000000));

```

and

```auto
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.

```auto
/**
		 * 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:
