A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: easy one :)

  1. #1
    Member
    Join Date
    Feb 2002
    Location
    Greece
    Posts
    48

    easy one :)

    hi!

    i want to assign a value to a variable that its name changes according to a counter. Say

    var1,var2,var3

    for this purpose i have a counter++;
    the problem is i don't know how to assign

    "var"+counter=something;
    does not work.

    I'm sure it's very simple but i just don't know how to do it
    ~m@gma~

  2. #2
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Code:
    this["var" + counter] = value;
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  3. #3
    Member
    Join Date
    Feb 2002
    Location
    Greece
    Posts
    48
    thank you very much! it works
    ~m@gma~

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