[web] [Flash-AS3] one image load, multiple uses

Started by
0 comments, last by Tesseract 15 years, 3 months ago
My friends and I have decided to try to make a game for flash player 9 in AS3. Since it'll be a real-time tiled strategy game, we will have the same tiles used(rendered) on different map locations. If we were to load the same tile over and over again for each map render this would eat up a lot of memory. So, now I'm asking, if there's a way to load the tile(bitmap) once and then, when I want to render it 100 times, I'd just referenced to it, instead of loading it again? Thanks!
Advertisement
Once loaded, make multiple bitmapData objects, and then do bitmapData.draw(myImage).

Or, you could create a Shape(), and then do a myShape.graphics.beginBitmapFill(myImage), but you might first have to draw myImage to a BitmapData object, and then myShape.graphics.beginBitmapFill(myBitmapData);

This topic is closed to new replies.

Advertisement