2 Replies Latest reply on May 5, 2006 6:11 AM by Newsgroup_User

    Trouple with FOR loop

    gregmax17
      Alright, I am wanting to make certain movie clips visible if the _root.variable equals 'i'. The dynamic text has a instance name on it, but am I using it correctly?

      for( var i=1; i<=6; i++)
      {
      if(_root.element_fire == i) {
      ('fire_'+i+'_text')._visible = true;
      }
      else
      {
      ('fire_'+i+'_text')._visible = false;
      }
      }
        • 1. Re: Trouple with FOR loop
          shyaway Level 1
          for( var i=1; i<=6; i++)
          {
          if(_root.element_fire == i) {
          this['fire_'+i+'_text']._visible = true;
          }
          else
          {
          this['fire_'+i+'_text']._visible = false;
          }
          }
          • 2. Re: Trouple with FOR loop
            Level 7
            for( var i=1; i<=6; i++)
            {
            this["fire_" + i + "_text"]._visible = ( _root.element_fire == i);
            }

            "gregmax17" <webforumsuser@macromedia.com> wrote in message
            news:e3dv3i$cqk$1@forums.macromedia.com...
            > Alright, I am wanting to make certain movie clips visible if the
            _root.variable
            > equals 'i'. The dynamic text has a instance name on it, but am I using it
            > correctly?
            >
            > for( var i=1; i<=6; i++)
            > {
            > if(_root.element_fire == i) {
            > ('fire_'+i+'_text')._visible = true;
            > }
            > else
            > {
            > ('fire_'+i+'_text')._visible = false;
            > }
            > }
            >