A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Multiple Variables

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1

    Question Multiple Variables

    I just want to know if there is a way to assign multiple variables, and if there is a way to check multiple variables.

    I want to be able to assign variables to false and then check if all the variables are false.

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Use for loops

    Actionscript Code:
    for(i=1;i<6;i++){
        this["myVar"+i] = false;
    } // will create myVar1, myVar2, myVar3, myVar4 and myVar5

    checking = 0;

    for(i=1;i<6;i++){
        if(this["myVar"+i] == false){
            checking++;
        }
    } // this checks if each variable is equals to false, and if it is, increases the checking variable

    if(checking == 5){
        trace("All Variables are set to FALSE");
    } // and if checking variable is equals to 5, then all the variables are set to false
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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