3 Replies Latest reply on Feb 11, 2008 6:06 AM by MoisesZAragoza

    dynamic object name

    MoisesZAragoza
      Hi,
      I have been having a problem get a dynamic object name

      i am trying to build a simple sample where i press a BTN it passes the name of the object but then i cant seem to use it.

      [CODE]
      Action Frame 1


      showHide();
      function showHide(myName) {
      trace(myName); // This returns ball1
      this.ball1._visible = false; // Hides object
      this.ball2._visible = false;// Hides object
      this.ball3._visible = false;// Hides object
      this.ball4._visible = false;// Hides object



      trace(this.myName._visible) // This does nothing
      this.myName._visible = true; // does not work



      }



      stop()
      [/CODE]


      [CODE]
      my Buttons

      on (press) {
      _root.showHide("ball1");
      }
      [/CODE]