Animation Stuck after window re-opens.

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

Hi, I am trying to animate an image view with a click event listener and it works fine, but after I close the window containing the image view and then re-open it the animation won't start or the event listener doesn't work. I'm not sure but it is not working. Can someone take a look at my code and see if something is wrong?

closebutton.addEventListener('click', function(e){
    gamewin.close();
    gamewin.remove(closebutton);
    gamewin.remove(number1);
    gamewin.remove(number2);
    gamewin.remove(number3);
    gamewin.remove(number4);
    gamewin.remove(number5);
    gamewin.remove(number6);
 
});
 
 
startbutton.addEventListener('click', function(e){
 
    gamewin.add(closebutton);
 
 
    gamewin.add(number1);
    gamewin.add(number2);
    gamewin.add(number3);
    gamewin.add(number4);
    gamewin.add(number5);
    gamewin.add(number6);
 
    gamewin.open({modal: true});
 
    number1.addEventListener('click', function(e){
        player.play();
 
      var matrix = Ti.UI.create2DMatrix()
      matrix = matrix.rotate(180);
      matrix = matrix.scale(2, 2);
      var a = Ti.UI.createAnimation({
        transform : matrix,
        duration : 500,
        autoreverse : true,
        repeat : 3
      });
      number1.animate(a);
 
        });
 
 
 
});

— asked 10 months ago by Raul Ochoa
2 Comments
  • it is helpful to provide platform information

    — commented 10 months ago by Aaron Saunders

  • It's for iOS and i'm running the emulator and also on an actual device running the latest version of iOS for the iPhone. Titanium SDK 2.1.1.GA

    — commented 10 months ago by Raul Ochoa

Your Answer

Think you can help? Login to answer this question!