# \[AS3\] Limitation of BitmapData loaded into memory through Loader.load()

**URL:** https://forum.kirupa.com/t/as3-limitation-of-bitmapdata-loaded-into-memory-through-loader-load/214349
**Category:** flash
**Created:** [January 27, 2007, 6:58pm UTC](https://forum.kirupa.com/t/as3-limitation-of-bitmapdata-loaded-into-memory-through-loader-load/214349 "2007-01-27T18:58:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![multiroger](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@multiroger](https://forum.kirupa.com/u/multiroger)
#### Post date: [January 27, 2007, 6:58pm UTC](https://forum.kirupa.com/t/as3-limitation-of-bitmapdata-loaded-into-memory-through-loader-load/214349/1 "2007-01-27T18:58:52Z")

</div>

I am creating a photo gallery using Loader.load() to load pictures into Flash Player 9. I plan to make them preloaded in advance so when the users turn the page they can see the pic on the new page right away without waiting. So the pics are loaded one after another automatically on backend. When users request a new page, the bitmap object are simply added onto the page’s display list.

I publish the code and test on IE 6 and Firefox 1.5. Only about 50 pics can be preloaded on FF and about 70 pics on IE. I read some articles talking about memory problem of Loader in Flash 8.5 alpha. So is it still a problem for “Flash 9 Actionscript 3 Preview Alpha” ? Check the article - [http://www.jessewarden.com/archives/2006/01/diesel\_battlefi.html](http://www.jessewarden.com/archives/2006/01/diesel_battlefi.html)

Following is my code for preloading job -

\*function loadImage(page:int):void  
{  
loader = new Loader();  
loader.load(new URLRequest(filePathArray[page-1])); // page = 1 initially  
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);  
}

private function loadComplete(e:Event):void  
{  
image = Bitmap(loader.content);  
imageArray[page-1] = image;\*

- if (page \<= totalPages)\*

- {  
loadImage(++page);\*

- }  
}

- 

Please advise. Thank you very much.
