Skip to main content
paleozogt
Participating Frequently
July 21, 2011
Question

valid AS3 will crash iPhone app on startup

  • July 21, 2011
  • 5 replies
  • 1710 views

Steps to reproduce:

1. Add this code to a Flex Mobile Project:

        public class Foo extends EventDispatcher {
             public override function addEventListener(type:String,  listener:Function, useCapture:Boolean=false, priority:int=0,  useWeakReference:Boolean=false):void {
                 var thisFunc:Function= arguments.callee;
                 super.addEventListener(type, listener, useCapture, priority, useWeakReference);
             }
         }

2. Refer to the class Foo somewhere in the application, for example the creation complete handler of MainHomeView.mxml:

        protected function view1_creationCompleteHandler(event:FlexEvent):void {
             var foo:Foo;
         }

3. Debug this on an iOS device using the 'Standard' packaging method.  Also, you could export a Release build for iOS.

When the iOS app launches, it will crash before running any code  written by the programmer-- just the *presence* of this code in the app  causes it to crash (!).  I'm attaching a crash log.

I've filed a bug for this here: https://bugs.adobe.com/jira/browse/FB-32130

This topic has been closed for replies.

5 replies

Participating Frequently
July 22, 2011

Hi,

Thanks for reporting the bug. Could you tell us the runtime version you are trying the code with?

Regards,

Sanika

paleozogt
paleozogtAuthor
Participating Frequently
July 22, 2011

Since its packaged for iOS, there is no runtime per se.  It's built with AirSDK 2.7 and/or Flash Builder 4.5.1, so whatever runtime those use.

Inspiring
June 24, 2012

Hi,

im using Flash Builder 4.6  in a mobile project.

Hhis cause a crash, can't see  nothing than the splash screen:

public static function getInstance():ApplicationData {

            if (!ApplicationData.instance){

                ApplicationData.instance = new ApplicationData(arguments.callee);

            }           

            return ApplicationData.instance;

}

private var applicationData:ApplicationData = ApplicationData.getInstance();

Is there any solution?

Thanks