Question

I really need some help on this, as I have no idea how to fix it! :/

Got a problem here.

My application is working fine on my computer, both offline and online (flash uploaded to our webservers). It works fine in both IE and Firefox.

However, some user do have problem running it in IE, while Firefox is still ok..

The app itself works, the error comes when trying to buffer some frames to a BitmapData.

So, in Firefox, it works great. In IE (on my computer) it works great. In IE (on other computers) it does not work, and this error is cast. It happens right at the end, which means it all works fine until the last time the function is run. (it's run like this to allow updating the progressbar. If I set the for loop to 180 then it all freezes untill completed. Thats why I do 10 and 10.)

Any help regarding this would be great, as I'm completely stuck here... I've traced the size of the bitmapdata, and at the time of the error it's 1920x1080, which is what it's supposed to be.


This is the code where it fails:

fpsoSWFBuffer = new BitmapData(fpsoMC.width, fpsoMC.height, false, 0x00ff0000);

And this is the whole function where the code is located:

public function bufferFpsoImages(evt:TimerEvent):void{
            for (var i:int = 0; i<10; i++){
                fpsoMC.gotoAndStop(currentFpsoFrame);
                fpsoSWFBuffer = new BitmapData(fpsoMC.width, fpsoMC.height, false, 0x00ff0000);
                fpsoSWFBuffer.draw(fpsoMC);
                fpsoImgArray[currentFpsoFrame] = fpsoSWFBuffer;

                currentFpsoFrame++;
            }

            if (currentFpsoFrame <= (totImg360-10)){
                //   Still buffering frames   //    

                myLoadingPanel.setBufferProg(currentFpsoFrame);
                var fpsoTimer:Timer = new Timer(1,1);
                fpsoTimer.addEventListener(TimerEvent.TIMER_COMPLETE, bufferFpsoImages);
                fpsoTimer.start();

            }else{
                //   All frames buffered   //   
                currentFpsoFrame = 0;
                fpsoLoaded = true;
                fpsoLoading = false;

                ncFPSO.removeElement(myLoadingPanel);
                myLoadingPanel = null;


                var fpsoBitmap:Bitmap = new Bitmap(fpsoImgArray[0]);
                fpsoBitmap.smoothing = true;
                fpsoImage.source = fpsoBitmap;

            }
        }

EDIT: I've added some debugging functions to it now, to be able to know where it fails. (as it works during debugging, I need to debug the realtime version online).

This is what I get:

ErrorID=2015
ErrorMessage=Error #2015
ErrorPos=fpsoSWFBuffer = new BitmapData(1920, 1080, false, 0x00ff0000);
CurrentFpsoFrame=168
Position in For Loop=8

EDIT2: And here is the error message I finally got inside of Flash Builder. So now it's crashing here too.. =/

ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData/ctor()
at flash.display::BitmapData()
at Main/bufferTemplateImages()[E:\Workspace - Flash Builder\vCog Workspace\vCog Communicator 3.0\src\Main.mxml:461]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()
Was it helpful?

Solution 2

It seems like IE have some sort of max memory useage restriction with flash, and Firefox does not.

I might be wrong, but I fixed it by rewriting my code to handle smaller files (less memory useage) and loading in a high-res image after the user have rotated the view.

I used to buffer 1,5GB meory, now I buffer about 750MB and it works.

Still strange that IE has limitations, and Firefox and Chrome does not...

Oh well.. =/

OTHER TIPS

Your buffering 1.5gb of memory? Flash keeps requesting memory from the OS until the OS can't give anymore. If it works on your computer, but not others, maybe their computers are running a lot of other program requesting memory and can't supply enough memory to your project. The other thing I would check is, what version of the OS they are using 32bit windows only can see a max of 2Gb of memory. Although This is simply a theory. Maybe try and compress the images first to limit memory usage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top