7 Replies Latest reply on Feb 26, 2009 4:28 PM by Gregory Lafrance

    Access dynamically created objects

    Francisc Level 3
      Hello!

      I create some images dynamically by running a for from 1 to a variable preset. The pictures have the IDs image1, image2 ... ("image"+i). I then add other properties.

      Problem is for each I need an onMouseOverHandler thant will swap the image with another.
      I can get the target image with event.currentTarget.id. But I cannot set it's properties with this["image"+i].source (I need to change the ones up to that as well) and I cannot access it with this.getChildByName("image"+i).source either.

      What am I doing wrong please?