Clear bmp/sprites of the memory
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Clear bmp/sprites of the memory

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    1

    Question Clear bmp/sprites of the memory

    Hi,

    how to clear bmp/sprites of the memory?

    I use this function to generate sprites of the lib:

    PHP Code:
    addSprite(tilesDimtilesDim"spr_" root["tile_" map][i][j], mcTile);

    function 
    addSprite(XintYintcStringmcObject) {
        
    cls getDefinitionByName(c) as Class;
        
    bmp = new cls(00) as BitmapData;
        
    sprite = new Bitmap(bmp);

        
    mc.addChild(sprite);

        
    sprite.X;
        
    sprite.Y;
        
    sprite.name c;

    I already tried this:

    PHP Code:
    bmp.dispose()
    bmp null 
    But it does not work, the memory continues to increase. Any idea?

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,746
    Flash is garbage collected so the actual bitmap data will remain in memory as long as there is a reference to it. The MC retains a reference to the bitmap data. Even after you get rid of the MC (and any other references to the bitmap data) you can't predict when the Flash garbage collector will run and release that memory.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  3. #3
    Member
    Join Date
    Oct 2016
    Posts
    53
    Off topic. Was look at you site northcode.
    Have spell mistake on home page in windows we support section.
    You have "we hanve bundled" instead of "we have bundled".
    Ciao

  4. #4
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,746
    Quote Originally Posted by Dezoid View Post
    Off topic. Was look at you site northcode.
    Have spell mistake on home page in windows we support section.
    You have "we hanve bundled" instead of "we have bundled".
    Ciao
    Fixed it, thanks
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center

Poll by Flashkit.com