Welcome, Guest
  • Author Topic: How to set a dynamic text variable to the object name?  (Read 733 times)

    Matt Farley

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Lets say I have a dynamic text box, inside the OVER frame of a button named 'RedButton', and I want to set it's Var: value to the parent button name: RedButton.  But instead of typing "RedButton" in the properties Var: section, I want to use something like "<parent.button.name> So I can duplicate the button and rename it to BlueButton, OrangeButton, etc, and the attached dynamic text's variables will automatically be changed to "OrangeButton" etc.  I hope this is clear :)  Any help?

    Thanks!
    -Matt

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Hi

    Put a MovieClip in the OVER state with a dinamic textfield inside the MC. In the first frame of the MC (dinamic textfield with instance name "myName") use this code:

    myName.text=_parent._name

    Then the textfield should show the name you give the button

    Jorge