A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: getting the instance name of a symbol dynamically

  1. #1
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807

    getting the instance name of a symbol dynamically

    hi,

    maybe i'm having a brain fart. but is there a way to get the instance name of a symbol w/ a/s?

    the scenario: i have a button symbol named "button." i want to have several instances of this button on my stage. each button will have different dynamic text over it. these texts will have instance names "button1Text" "button2Text" etc and the button instances will be named "button1" "button2" etc, respectively. i will have a script on the button that looks something like this:

    pseudocode:

    Code:
    on(rollOver){
    bttnInstanceName = this._______;
    myText = bttnInstanceName + "Text";
    myText.text = rollOverText;
    //obviously there is a problem here since myText is a string and
    //I'm trying to target a text instance name and set it to a
    //predetermined variable "rolloverText"
    }
    any tips? advice? other approaches that may accomplish the same thing? basically i am trying to make a master button that doesn't have to be altered to be used all over the place. thanks.

  2. #2
    Goooold Member!
    Join Date
    Oct 2002
    Posts
    259
    bttnInstanceName = this._name;

  3. #3
    FK M.D. pheck's Avatar
    Join Date
    Jul 2001
    Location
    MN
    Posts
    807
    thanks!

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