1 Reply Latest reply on May 7, 2008 12:55 PM by kglad

    syntax question

    posterboy
      i wonder if there is a better way to write this code snippet...

      // function saturnBtn (item) {
      // this["icon_"+item+"_mc"].onRollOver = function() {
      // }
      // }
      //
      // saturnBtn ("saturn")
      // saturnBtn ("csm")
      // saturnBtn ("lm")


      i was trying an Array i.e.

      // saturnBtn2 = new Array ["saturn", "csm", "lm", "lma", "sr"]

      the result was not good.

      also, what is the correct syntax for replacing a string with a variable in this example?

      String version
      // attachMovie( "newClip_mc", "newClip_mc", 3, {_x:98, _y:42});

      Variable version
      // attachMovie( [item+"_mc"], [item+"_mc"], 3, {_x:98, _y:42});

      Thanks > Mark