6 Replies Latest reply on Mar 14, 2011 3:37 PM by Hitomi Kudo

    Simple AS3 code that causes 10.2 to crash

    mike_brewer

      Very simple code that causes flash 10.2 to crash on all platforms.

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="300" minHeight="200">
           <fx:Script>
                <![CDATA[
                     import mx.controls.Alert;
                     private function crash(type:int, ...additionalArgs):void {
                          var msg:String;
                          switch (type) {
                               case 1: msg = "Crashes!"; break;
                               case 2: msg = additionalArgs[0]; break;
                          }
                          Alert.show("Crash : " + msg);
                     }
                     private function notCrash(type:int, ...additionalArgs):void {
                          // Does nothing at all, but stops the crash....
                          if (additionalArgs) {}
                          var msg:String;
                          switch (type) {
                               case 1:msg = "Not crash"; break;
                               case 2: msg = additionalArgs[0]; break;
                          }
                          Alert.show("NotCrash : " + msg);
                     }
                ]]>
           </fx:Script>
           <s:Button label="Does not crash flash" click="notCrash(2,'value')" x="10" y="10"/><s:Button label="Crash flash" click="crash(2,'value')" x="150" y="10"/>
      </s:Application>
      
        • 1. Re: Simple AS3 code that causes 10.2 to crash
          Hitomi Kudo Level 3

          mike_brewer,

           

          Thank you for reporting the bug. We will take a look at this bug asap.

           

          thanks,

           

          Hitomi

          FP/AIR team

          1 person found this helpful
          • 2. Re: Simple AS3 code that causes 10.2 to crash
            mike_brewer Level 1

            hkudo wrote:

             

            mike_brewer,

             

            Thank you for reporting the bug. We will take a look at this bug asap.

             

            thanks,

             

            Hitomi

            FP/AIR team

             

            Hi Hitomi

             

            Thank you! Finally someone is looking into this.

             

            I have also submitted a bug report on your site about this issues.

             

            Currently for the developers there is a simple workaround; which is to wrap the switch statement that uses a rest parameter in a try/catch. This

            prevents the crash even though the catch statement is reached!

             

            I have also have another forum post that goes into more detail about this :

            http://forums.adobe.com/thread/795395?tstart=0

             

            Regards Michael

            • 3. Re: Simple AS3 code that causes 10.2 to crash
              Hitomi Kudo Level 3

              Hi Mike,

               

              To keep track this issue here is the internal bug number I logged: #2822118

              I'll let you know if there is update on the bug you rpeorted.

               

              thanks,

               

              Hitomi

              • 4. Re: Simple AS3 code that causes 10.2 to crash
                tfritsch

                Hi !

                 

                @Mike : thanks A LOT for your help finding out what is causing so many websites to bug and finding that workaround (the solution is almost as crazy as the bug itself ).

                 

                @Hitomi : thank you for taking this huge problem into consideration. Do you have an idea of when the bug will be corrected ?

                 

                I hope this situation will end shortly since it is difficult to argue on flash platform stability when we have such flash player release. I think it has a real negative impact on our business as flash platform developers (we struggle to convice our clients that flash is a reliable platform, it is difficult to do so when every end-users keep complaining all day long). I hope Adobe is aware of this situation and will react very quickly.

                • 5. Re: Simple AS3 code that causes 10.2 to crash
                  j_schoenherr

                  Not sure if this helps at all, but wanted to mention it.

                  I've been searching all over for answers to this bug, as it caused some of my flash apps to crash the browser.  Not all though - which is what was strange.  I tried the "wrap your switch statements with try-error" fix, but that didn't work.

                  What clued me in - to my issue at least - was that I have a swf that is embedded in one scenario on a page, and another loaded from another swf.  One was working, the other crashing - even though it was the exact same swf.

                   

                  Long story (not) short - turns out some of my flash pieces are passing params as FlashVars in my js code, while others are passing them as appended to the filename of the swf (e.g. "http...filename.swf?param=a&param2=b").  It's kinda ancient embed code - I don't use swfObject or better methods.

                  But the instances I had passing FlashVars crashed the 10.2 plugin, while the other didn't.  Upon changing my js to append them to the filename instead of using FlashVars, they were fixed.

                   

                  Hope that offers a little help.

                  • 6. Re: Simple AS3 code that causes 10.2 to crash
                    Hitomi Kudo Level 3

                    Hi mike_brewer and all,

                     

                    We think we found the fix for this bug and we are looking for help to verify the fix. Can I ask you to add our private pre-release program so we can give you the build with this fix? We greatly appreciate if you can do to help. Please send me your information to hkudo@adobe.com:

                     

                    your name:

                    company/organization name:

                    email address:

                     

                    Thank you!

                     

                    Hitomi