dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Variables

  1. #1
    Registered User
    Join Date
    Mar 2001
    Posts
    34

    Variables

    Hi, I'm trying to use a variable in an instance name ie.,
    variable is resort with a value of "BEACH"

    on (release) {
    var resort = "BEACH";
    this.resort_BUG.gotoAndPlay("on");
    this.resort_LABEL.gotoAndPlay("on");
    this.resort_PIN.gotoAndPlay("on");
    }


    instance names are:
    BEACH_BUG,BEACH_LABEL,BEACH_PIN

    what is wrong with this code?

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    code:
    on (release) {
    var resort = "BEACH";
    this[resort+"_BUG"].gotoAndPlay("on");
    this[resort+"_LABEL"].gotoAndPlay("on");
    this[resort+"_PIN"].gotoAndPlay("on");
    }


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