-
Flash memory
Hi Flashers,
Im creating a game, and its working out pretty well. I just encountered a little problem. I have a timer in my game which creates every 5 seconds an new instance of a class and adds it on the stage. No problem voor memory, but when I use bitmaps to be called on any 5 seconds, flash is slowing down more and more by every bitmap it shows more on the stage.
I can't re-use or delete the bitmaps. What can I do to make it not slow down? I'm out of options.
Thanks.
-
I mushrambo, you should use the function dispose to clear the bitmap from memory when you dont need it anymore..
exemple :
bitmaptodelete.bitmapdata.dispose();
-
Thanks for your answer!
It works fine, however it doesnt solve my problem. I disposed my bitmap images and also removed my sprites when I don't need them anymore (atleast I think I did) but still, after a short while playing the game, it lags, everytime a little bit more and more. I let objects come with a certain timer. When the score reached several points, the timer decreases so the objects which will be generated newly incrased aswell. The memory peak is 15.000 kb, so I guess that is OK. I don't know how to optimize my code further!
-
hey mushrambo,
if the sprites have any listeners attatched to it It can cause lag too.
anyways its hard to guess whats wrong without seeing the code, can you post it? or send it to my email josuemota@gmail.com (just the part with the problem)
-
hey mushrambo,
if the sprites have any listeners attatched to it It can cause lag too.
anyways its hard to guess whats wrong without seeing the code, can you post it? (just the part with the problem)
-
Hi spacemonkey,
Thanks for your time, but I fixed it myself. I forgot about an array filling itself and I never deleted it.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|