Oliboy50

Q: Click event (activate?) on images inside a GalleryView

Hi,

 

i tried few things in iAd Producer but now what i need to do is "go to page myPage" after taping/clicking on one of the images contained by a GalleryView.

 

So i tried to handle this using the Activate event of my image layer, but the problem is that event is more like a didTouchDown event followed by a didTouchUpInside event than a true click event...

 

Sorry if i'm not clear enough, what i mean is that if i touch the image then drag the GalleryView then release my touch from the image : the Activate event will be triggered... but what  i wanted to do was just drag the GalleryView.

 

Does anyone know an alternative event that will be triggered only if the drag event is not triggered ?

 

(I'm a developer, i can write some JS code if needed.)

 

Thanks !

Posted on Oct 22, 2013 10:12 AM

Close

Q: Click event (activate?) on images inside a GalleryView

  • All replies
  • Helpful answers

  • by patixa,

    patixa patixa Oct 31, 2013 11:33 AM in response to Oliboy50
    Level 3 (597 points)
    Oct 31, 2013 11:33 AM in response to Oliboy50

    I don't understand your question. Are you trying to support both tapping and dragging of images? If so, you will need to override the various touch events. To create an event handler, select each image in the gallery, then Code > Object Events > Touched Down (as one example) > Execute JavaScript; a code snippet will appear in the Code Editor window to get you started.

  • by Oliboy50,

    Oliboy50 Oliboy50 Nov 5, 2013 2:11 AM in response to patixa
    Level 1 (4 points)
    Nov 5, 2013 2:11 AM in response to patixa

    Thank you for your reply.

     

    I thought the title of my question was clear enough.

     

    I want to click on images that are inside a GalleryView but only trigger the click event if the drag event isn't triggered itself... actually if I set a click event on those images now, I can't use the gallery view properly without trigger a click event...

     

    I thought i could do this using "event.preventDefault()" on click event if drag event is triggered... but that means users will have to be really accurate when clicking on images...

     

    Still don't know the best way

  • by rtakayasu,

    rtakayasu rtakayasu Nov 18, 2013 10:51 AM in response to Oliboy50
    Level 1 (45 points)
    Nov 18, 2013 10:51 AM in response to Oliboy50

    Hi,

     

    You must be doing diffently than I am.  My gallery appears to be doing what you're looking for; swipe will change the gallery view (previous/next cell) and tap will activate my JS code.

     

    I have the gallery view with images on an iPhoen project.  The images in the 1st and 2nd cell have the onviewactivate event.  I just changed my image in my 2rd cell to got to page action.  Both behaves as expected on my iPod touch.

     

    If we can identify how you're doing differently, maybe we can help you.

     

     

    -Takayasu