Update: Look at the "
Flash Player Bitmap Limits continue" topic for an update.
The last few weeks I have spend most of my time creating workarounds for limits within the Flash Player regarding BitmapData.
In the Flash Player 9 era things where "simple" a bitmap bigger than 2880x2880 fails to render when using BitmapData/Mask or Filters. Just loading an image had also a limit, which was something like 8191x8191.
For Flash Player 10 the limits are raised. Our mutual friend
Keith Peters posted a blog item called "
Big Ass Bitmaps in Flash 10". The limits Keith found are partly true, well they are all true for BitmapData but for Filters (which are eventually also Bitmaps I think, could be wrong) it's not true, for those the 2880x2880 limits are still in order as I found out.
For this limit I wrote a class which slices a big image into small pieces and those are tilled together. Because masking is also effected with the limits the class also maps masks on the image.
Another Flash Player strange behavior is it's memory management. Instead of throwing an event or exception when there is no more memory left the Flash Player decides itself which asset to drop (an image in my case). I want that control and the notification why and when it is dropping assets, there is an event that can be caught regarding the memory but it fails most of the times.
The project I'm working on is maybe not really suitable for the Flash Player because it has to load such big images (up to 5000x5000px) and create a compositions with sizes like 8000x4000 with a multiple of such images. The composition then has to be saved, therefor I used a so called Bucket technique, I slice pieces of 1000x1000 and send those a piece to a server which melts the images back together.
The memory usage peaks at 1.3GB reported with the “System.totalMemory” method and than it drops usually the last loaded image.