Blog Categories
- Art (37)
- ChineseBrush (9)
- Draw (5)
- Photoshop (6)
- Practice (16)
- Comics (169)
- Blonde Shelly (2)
- Cooking (8)
- Danny's Comic Journal (101)
- WebDesign (11)
- You had me at Croissant (68)
- 00_IntroBySofia (2)
- 01_InCalifornia (6)
- 02_TravelToLyon (11)
- 03_InLyon (46)
- 99_sidenote (2)
- Games (13)
- Flash Game (4)
- Links (2)
- News (57)
- Tutorials (39)
- How To (12)
- Lessons Learned (1)
- Materials (7)
- Observation (5)
- Technique (14)
- Uncategorized (1)
Danny Around The Web
Links
Blog Archive
- December 2008 (8)
- November 2008 (4)
- October 2008 (1)
- September 2008 (3)
- August 2008 (6)
- July 2008 (4)
- June 2008 (14)
- May 2008 (3)
- April 2008 (8)
- March 2008 (17)
- February 2008 (25)
- January 2008 (25)
- December 2007 (17)
- November 2007 (19)
- October 2007 (5)
- September 2007 (49)
Meta

I know this is supposed to be an art blog, but as soon as you introduce a computer, the lines between art and engineering start to get blurred. Regardless, I found this Flash AS3 Memory Leak to be such a landmine that I just had to post it somewhere for other people to hopefully find and breath a sigh of relief when they realize why their flash game slows down and grinds to a halt the longer they play it.
Okay, no beating around the bush. Do this code once a frame (or more!) and you’re flash game will grind to a halt.
mySprite.graphics.beginFill( 0xFFFFFF );
mySprite.graphics.drawRect( vPos.x, vPox.y, vSize.x, vSize.y );
mySprite.graphics.endFill();
This was my “DrawBlock” function for my falling blocks game. I see these three lines posted all over the web in tutorial and in forums. –Worse, I often only see the first two lines and no endFill(). The above code eats memory.


