animated views and addEventListeners not listening

You must Login before you can answer or comment on any questions.

As the title suggests, I've been trying to get addEventListeners to respond to clicks on views during animation.

Looking at this post from two years ago I thought I'd reintroduce the question by sharing what I have learned.

The view I'm toying with is being rotated and scaled via a 2Dmatrix and also traversing across the screen by setting the animation top and left parameters.

A partial answer

Though I've had no luck interacting with animated views directly, I did find I could add a filler view (where height/width are Ti.UI.FILL) and an addEventListener for the child view will respond to clicks, despite the parent view not listening. BUT I can only get this to work when the parent view is being rotated and scaled. It does NOT work with when I specify a top/left/bottom/right parameter in the animation declaration.

Anyway, this doesn't fix my problem, but thought I'd share what I have learned. If anyone knows of a way at all to get an animated view to respond to listeners while traversing across the screen, I'd love to here it!

Currently using Ti.SDK 2.1.0v20120501131823

— asked 12 months ago by Trevor Borgmeier
2 Comments
  • Okay, after further examination anda little sleep, i've found that you don't need the filler view to get addEventListeners to work with 2dMatrix transition animations. Those will work on the view as they should, it's just the traversing animations that don't listen.

    — commented 12 months ago by Trevor Borgmeier

  • Any chance you can share a code sample for us. I am trying to fire some click events from a rotated view and I can't make it work.

    — commented 11 months ago by Wouter Van den Bosch

1 Answer

I saw this bugfix in the 2.1.1 release notes:

Animation: A view moved by an animation no longer responds to touch events. (Touch events are generated based on the original location, not the new location.) (TIMOB-10042)

Note that this was an android fix; you didn't mention a specific platform, so this may or may not be helpful.

Your Answer

Think you can help? Login to answer this question!