Turns out this is a Player bug.  An engineer investigated and filed it.  Some notes:

 

In this case, it turns out the bug is in the player, not the compiler.  It's actually even worse than he says: you can have a single switch statement, not a nested one, and still reproduce the problem.

 

The workarounds are the ones he already discovered: either to set a breakpoint earlier in the function and then step until you get to the code you want to examine, or else don't use if/then instead of a switch statement.

 

So we’ll see what we can do but you know what you can do in the meantime.

 

Matt


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of EECOLOR
Sent: Tuesday, October 10, 2006 1:47 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] FLEX BUG: Nested switch case statements fail to compile correctly

 

Hello,

 

the problem might be caused by the { and } you place around you switch statements. The following code works just fine.

 

 

Greetz Erik

 

  public function testAS()
  {
   var x1:Object = {type: "x", data: {a: 1}};
   var x2:Object = {type: "x", data: {a: 2}};
   var y1:Object = {type: "y", data: {a: 3}};
   var y2:Object = {type: "y", data: {a: 4}};
   
   check(x1);
   check(x2);
   check(y1);
   check(y2);
  };
  
  private function check(o:Object):void
  {
   switch (o.type)
   {
     case "x":
       switch (o.data.a )
       {
        case 1:
            trace("1 X");
            break;
        case 2:
            trace("2 X");
            break;
       };
        break;
     case "y":
       switch (o.data.a)
       {
         case 3:
            trace("3 Y");
            break;
        case 4:
            trace("4 Y");
            break;
       };
      break;
    };
  };
 

 

output:

1 X

2 X

3 Y

4 Y

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to