Yes,  BMP Obj remains in memory, you need to have a reference to that Object
so you can dispose it later.

import flash.display.BitmapData;
var bitmap:BitmapData;

function createBitmap():Void {
   bitmap = new BitmapData(500, 500, false, 0xFF0000);
   _root.attachBitmap(bitmap, 0);
}

clickObj = {};

clickObj.onMouseDown = function()
{
    _root.bitmap.dispose();
}

Mouse.addListener( clickObj );

createBitmap();

On 3/24/06, Dimitrios Bendilas <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Quick question.
>
> private function createBitmap():Void {
>     var bitmap:BitmapData = new Bitmap(200, 200, false, 0xFF0000);
>     clip.attachBitmap(bitmap, 0);
> }
>
> If I never execute .dispose() on the bitmap, does it remain in memory?
> It seems logical to me that it remains there only until the function is
> finished. It's a local variable so I would expect the memory gets freed
> as soon as the local variable dies.
>
> Thanks!
>
> Regards,
> Dimtirios Bendilas
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to