A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Simple Question!

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    5

    Post

    Hey, I need to use a command like the C+'s switch...
    Example:
    switch(X)
    {
    case 1: printf("X value is 1"); break;
    case 2: printf("X value is 2"); break;
    case 3: printf("X value is 3");
    }

    Any idea?

    THANKS!

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    use a long if-else chain ... get a few thousand people to write to MM and ask for the feature ... write a precompiler that converts switch into if-else for you before flash (or some other compiler) even will see it
    If you want to see the feature in one of the alternative products, sending a few barrels of beer might help

    There is no support for switch in actionscript byte code, so whoever does it would just create an if-else chain internally. If you do that in your own code, you can optimize the order of cases - if you leave it to a compiler, it might just do it the wrong way for your particular movie

    Musicman

  3. #3
    Junior Member
    Join Date
    Nov 2001
    Posts
    5
    Thanks for the help musicman!

    C-ya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center