4 Replies Latest reply on Feb 28, 2007 5:16 AM by Pal_w_G

    Dynamic onPress Problem

    phil ashby
      Hi guys and gals,

      I've got a database of objects - textareas, images etc that I'm pushing into an Array (pageElements) and then displaying on the screen. When It comes to images, I want the user to be able to set the image as a link hot spot, so they can click the image and it goes to a new URL.

      This is the code I'm using to load and resize the image and then add in an onPress Handler

      The problem comes with the fact that when I assign the onPress handler to the image the URL is set based upon the actual dynamic looped variable that i'm in at the time. When I come to actually PRESS the image, the variable is no longer valid. How can I punch the actual URL into the onPress handler so that it works?

      Hope that sorta makes sense.

      Cheers
      Phil