Skip navigation
witherton
Currently Being Moderated

Possible to convert this var into a string??

Jun 29, 2012 9:35 AM

var buttons:Array=[button1,button2,button3,button4];

if(buttons[a].currentLabel != "1")

{var  numberButtons=buttons[a].currentLabel;

trace (numberButtons);}

 

trace (numberButtons) returns:

3

5

7

 

How do I turn this into the string "357"?

 
Replies
  • Currently Being Moderated
    Jun 29, 2012 9:59 AM   in reply to witherton

    You can't be showing all of the code related to that output which makes it difficult to answer you.

     

    Take each result and add it to a String variable.

     

         var yourString:String = "";

     

    layer on somewhere....

     

         yourString += String(numberButtons);

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 10:02 AM   in reply to witherton

    var numberButtons:String="";

    var buttons:Array=[button1,button2,button3,button4];

     

    if (buttons[a].currentLabel!="1") {

        numberButtons+=String(buttons[a].currentLabel);

    }

    trace(numberButtons);

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 12:16 PM   in reply to witherton

    you're welcome

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 12:47 PM   in reply to witherton

    You're welcome

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 2:24 PM   in reply to witherton

    numberButtons=""

     

    After show the first trace

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 3:02 PM   in reply to witherton

    you´re welcome again

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points