Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: AS3 bitmap data. Blur won't become transparent.

  1. #1

    AS3 bitmap data. Blur won't become transparent.

    Hi. I am trying to finally get my head around bitmapdata and filters. I have made a simple flash that has a movieclip of a circle in the library. I add it to the stage and then make it follow the mouse. Then i use it to draw to a bitmap and then apply a blur. The problem is that the blur doesn't become transparent, and eventually fills the whole screen. I've tried using a colorTransform and a ColorMatrixFilter but they don't seem to work.

    Here's the code. What i really want is the blur to gradually become transparent towards the edges, in the way a gaussian blur would work in PS.

    Code:
    var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0xFFFFFF);
    var bm:Bitmap = new Bitmap(bmd);
    
    addChild (bm);
    var bf:BlurFilter = new BlurFilter(6,6,1);
    /*var cmf:ColorMatrixFilter = new ColorMatrixFilter([0.9,0,0,0,0,
    						  0,0.9,0,0,0,
    						  0,0,0.9,0,0,
    						  0,0,0,0.6,0]);*/
    var cTransform:ColorTransform = new ColorTransform();
    cTransform.alphaMultiplier = 0.65;
    var gfx:bmGraphic = new bmGraphic();
    addChild(gfx);
    this.addEventListener(Event.ENTER_FRAME, frameHandler);
    
    function frameHandler(e:Event):void{
    	gfx.x = stage.mouseX - (gfx.width/2);
    	gfx.y = stage.mouseY - (gfx.width/2);
    	bmd.colorTransform(bmd.rect, cTransform);
    	bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
    	bmd.draw(this);
    }
    If anyone can help me that would be great. I feel like i'm missing the point here.


    edit: Oops. Thought i was in the as3 section .... sorry.
    Last edited by Iamthejuggler; May 22nd, 2008 at 06:17 AM.

  2. #2
    Something like this?

    egg

  3. #3
    That would be exactly what i wanted, if it wasn't doing the same as mine. Turn the stage to white and you'll see that what looks like transparent is actually just filling the stage with opaque black.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012