The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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