• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stop the animation while it is in progress?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stop the animation while it is in progress?


  • Subject: Stop the animation while it is in progress?
  • From: Bob Ueland <email@hidden>
  • Date: Wed, 14 Nov 2007 06:58:17 -0800 (PST)

Hi I have a simple image that I animate (move horizontally) on the screen from startLoc to endLoc. The animation happens when the user clicks on the Animate button (which triggers the animate action). The animation happens during 6 seconds (I set duration=6.0). There is also a Kill button (which triggers the kill action). What I want is to kill the animation while in progress. I tried to do it by setting location of the image outside screen, but it did not work. How What should I do in order stop the animation while it is in progress?


- (IBAction)animate:(id)sender
{
    position.origin.x = startLoc;
    [view setFrame:position];
    position.origin.x = endLoc;
    [NSAnimationContext beginGrouping];
    [[NSAnimationContext currentContext] setDuration:duration];
    [[view animator] setFrame:position];
    [NSAnimationContext endGrouping];
}

- (IBAction)kill:(id)sender
{
    position.origin.x = startLoc;
    [[view animator] setFrame:position];
}
@end





      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Heads Up: Code generation bug
  • Next by Date: Re: [SOLVED] Resetting of property values after completion of a CABasicAnimation
  • Previous by thread: Re: After upgrade to leopard: "principalClass is nil" while loading preferencesPane
  • Next by thread: Re: [SOLVED] Resetting of property values after completion of a CABasicAnimation
  • Index(es):
    • Date
    • Thread