Skip to main content
Participant
July 3, 2013
Question

slide show for ios and android crash

  • July 3, 2013
  • 3 replies
  • 721 views

Hi All,

     i have create a app for ios and android. it will load some image dynamically from local directory and show on screen. but i realize after few hour the app will automatically crash. please help. code below is my code

timer = new Timer(AppSetting.SCREENSAVER_INTERVAL * 1000);

                timer.addEventListener(TimerEvent.TIMER, loadNewImage);

                timer.start();

private function loadNewImage(e:TimerEvent):void {

                            //timer.

           

            //timer.removeEventListener(TimerEvent.TIMER, loadNewImage);

            //var f_Index:int = int(Math.random() * images.length);

           

            var f_Loader:Loader =  new Loader();

            f_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void {

                //trace(System.totalMemory / 1024);

                f_Loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, arguments.callee);

                f_Loader = null;

               

                if (screensaver) {

                   

                    removeChild(screensaver);

                    screensaver.bitmapData.dispose();

                    screensaver = null;

                    //System.gc();

                }

               

                screensaver = Bitmap(f_Loader.content);

                addChild(screensaver);

               

                screensaver.width = AppSetting.STAGE.stageWidth;

                screensaver.height = AppSetting.STAGE.stageHeight;

               

               

               

            });

           

            f_Loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void {

                trace("load screensavers image error!");

            },false);

            try {

       

                f_Loader.load(new URLRequest(File.applicationStorageDirectory.resolvePath(AppSetting.SCREENSAVER_PATH + images[f_Index]).url));

               

                f_Index = f_Index + 1;

                if (f_Index == images.length)

                {

                    f_Index = 0;

                }

               

            } catch (e:Error) {

                trace("load screensavers image error!");

            }

           

            //timer.addEventListener(TimerEvent.TIMER, loadNewImage);

            //trace(System.totalMemory / 1024);

           

            dispatchEvent(new Event(LOADED));

           

        }

i have set all var to null but it still crash.

This topic has been closed for replies.

3 replies

Known Participant
July 28, 2013

I have a similar problem for my slideshow application. Does your application crash (to homescreen), gives a runtime error or freezes?

My application freezes, it seems to lock the main thread on iOS... After 3,5-4 hours running this happens

chris.campbell
Legend
July 29, 2013

Could you please open a new bug report on this over at bugbase.adobe.com?  When adding the bug, please include sample code or an application so we can quickly test this out internally.  If you'd like to keep this private, feel free to email the attachment to me directly (ccampbel@adobe.com). 

Once added, please post back with the URL so that others affected can add their comments and votes.

Thanks,

Chris

Known Participant
August 6, 2013