How to stop a repeating layer animation or switch to another one?

Hi
I have set up CAKeyframeAnimation as follows. Is there any way to make it to switch to another animation at the press of a button? I figure I need to disable or stop the animation first before assigning another CAKeyframeAnimation or CABasicAnimation, but I could not figure out a way to do this. I have tried removing the animation from the layers using 'removeAllAnimations" when a button is pressed, the animation did stop, but the images jump back to the original state. Changing the fillMode to kCAFillModeForwards will not help since the animation did not complete.
Thanks in advance,
aobs
----- Code -----
\[CATransaction begin\];
\[CATransaction setAnimationTimingFunction:\[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear\]\];
\[CATransaction setValue:\[NSNumber numberWithFloat:2.0f\] forKey:kCATransactionAnimationDuration\];
// Assigning animation to the 10 layers.
\[thisLayer1 addAnimation:\[self scrollAnimation:layerNumber\] forKey@"customScrollAnimation"\];
\[CATransaction commit\];
-(CAKeyframeAnimation *)scrollAnimation:(NSInteger)layerNumber {
CGMutablePathRef animationPath = CGPathCreateMutable();
// Create animationPath and the keyTimes array.
CAKeyframeAnimation *movePositionAnimation =
\[CAKeyframeAnimation animationWithKeyPath:@"position"\];
movePositionAnimation.path = animationPath;
movePositionAnimation.keyTimes = \[NSArray arrayWithArray:keyTimes\];
movePositionAnimation.repeatCount = 50;
movePositionAnimation.removedOnCompletion = NO;
movePositionAnimation.fillMode = kCAFillModeForwards;
CGPathRelease(animationPath);
return movePositionAnimation;
--

Restart with the Shift key held down, log in, and delete it or remove it from the list of login items for your user account in the Users & Groups pane of System Preferences.
(83858)

Similar Messages

  • I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    I have been sampling new imported drum loops. And if I adjust region to song or time strecth it updates the audio file in the library. How to stop this? I lost the original setting to one loop. automatically doing it ??

    This "original file cannot be found" thing happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • How to stop photos, text and email from appearing on another phone

    My daughter gets my email, photos and text messages.  I have no idea how this is happening.  Any idea how to stop it from appearing on her phone? It is frustrating to her and me.  My wife doesn't have the problem, nor does my daughter get my wife's email, photos and text.
    My daughter had this problem with an iPhone 4s and 5s.  My wife and I have each have an iPhone 4.

    See:
    *Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    *Tools > Options > Privacy > History: "Remember search and form history"
    *https://support.mozilla.com/kb/make-firefox-remember-usernames-and-passwords
    *https://support.mozilla.com/kb/Form+autocomplete

  • In Flex 3 how to Stop and Replay .swf animation created in Flash

    Hi
    I have an animation file that is created in Flash (I think
    CS3). In Flex if I import it inside a SWFLoader or if I import it
    as an Image. It plays once and stops. Then I can not replay it. I
    also can not pause it when its playing.
    I have tried few things based on help and code available in
    the Web to of no help. I have tried to convert the swfLoader
    instance to a movie clip like so to stop
    var c:MovieClip = swfLoaderHeaddress1.content as MovieClip;
    c.stop();
    <mx:SWFLoader x="53" y="116" width="206" height="255.3"
    visible="true"
    source="assets/animations/curatorial/ZoomHeadress_2nd.swf"
    id="swfLoaderHeaddress1"/>
    It does not work.
    I have not created the .swf animation, I am not sure how it
    is done. I belive it may not be using any ActionScript as I know
    the artist who created it does not know ActionScript. Does
    something need to be done inside the Flash to support the stop and
    play? Or is there a way to restart/replay stop a .swf animation in
    Flex 3 no matter how (and whether or not its developed using
    ActionScript) its developed in Flash?

    One way is she has to add some AS code to the animation, or
    you can do it yourself.
    In swf there must be something like this:
    var connReciever:LocalConnection = new LocalConnection();
    connReciever.client = this;
    connReciever.connect("fromFlexToSWF");
    function myFunction(parameter:SomeClass):void {...}
    And in Flex:
    var connSender:LocalConnection = new LocalConnection();
    connSender.send("fromFlexToSWF", "myFunction", [..args]);
    The other way: in case with just play/stop there is a way to
    resolve this by using that Flex Component Kit (or maybe "Flex Skin
    Design Extension", i do not remember), it is something like she
    just adding labels to animation frames then she exports it with
    Flex Kit and then you can work with it like with an object with
    "states".

  • How to stop and resume the animations of nested movieclips

    Hi
    I have many nested movieclips  in different positions of the main timeline.
    I have 2 buttons, play_btn and pause_btn.
    I'd like when the user click pause_btn, the animations on the main timeline and in nested movieclips stop.
    Whe he click play_btn the animations resume in both the main timeline and nested movieclips.
    I have created array of nested movieclips on the main timeline.
    var arr:Array = new Array(mc1, mc2, mc3, mc4, mc5);
    play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
    pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
    function on_play_btn(e:MouseEvent):void
         gotoAndPlay(currentFrame);
         for(var i:Number = 0; i < arr.length; i++)
             if(arr[i] != null)
                 arr[i].play();
    function on_pause_btn(e:MouseEvent):void
         gotoAndStop(currentFrame);
         for(var k:Number = 0; k < arr.length; k++)
             if(arr[k] != null)
                 arr[k].stop();
    but it only stops the animations on the main timeline and dosen't stop the animations in the nested movieclips.
    Help me Please.

    I'm having the same issue.I have a main timeline, which has nested movieclips with there own timelines and motion tweens. Using the new motion tween, and not the classic tween, which may or may not be the problem.
    Was having a similar issue with stopping the timeline, the main timeline would stop, but the nested movieclips would keep going. Found this blog post that helped.
    http://blog.nobien.net/2009/02/05/as3-stopping-all-timeline-animations/
    Used the code below to stop everything by passing the stage as the displayObject. Worked great, but now i'm having the reverse issue. When I resume play, the nested movieclip timeline stays exactly where I stopped it, and the main timeline resumes play. If there are a 100 frames in the nested movieclip, once it reaches the 101st frame, the main timeline kicks in again.
    function stopAllChildMovieClips(displayObject:DisplayObjectContainer):void{
            var numChildren:int = displayObject.numChildren;
            for (var i:int = 0; i < numChildren; i++) {
                var child:DisplayObject = displayObject.getChildAt(i);
                if (child is DisplayObjectContainer) {
                    if (child is MovieClip) {
                        MovieClip(child).stop();
                        stopAllChildMovieClips(DisplayObjectContainer(child));

  • How can I delete repeats in my iPhoto library without going one at a time?

    I have been trying to clean up my iphoto library, and find that many of my imports have been repeated in different places. Is there a way to clean out repeat photos so there aren't so many of the same ones without having to do so one at a time?

    You can use any one of these applications to identify and remove duplicate photos from an iPhoto Library:
    iPhoto Library Manager - $29.95
    Duplicate Cleaner for iPhoto - free - was able to recognize the duplicated HDR and normal files from an iPhone shooting in HDR. 
    Duplicate Annihilator - $7.95 - only app able to detect duplicate thumbnail files or faces files when an iPhoto 8 or earlier library has been imported into another.
    PhotoSweeper - $9.95 - This app can search by comparing the image's bitmaps or histograms thus finding duplicates with different file names and dates.
    PhotoDedupo  - $4.99 (App Store) - this app has a "similar" search feature which is like PhotoSweeper's bitmap comparison.  It found all duplicates.
    DeCloner - $19.95 - can find dupicates in iPhoto Libraries or in folders on the HD.
    Some users have reported that PhotoSweeper did the best in finding all of the dups in their library: i photo has duplicated many photos, how...: Apple Support Communities.
    If you have an iPhone and have it set to keep the normal photo when shooting HDR photos the two image files that are created will be duplicates in a manner of speaking (same image) but the only diplicate finder app that detected the iPhone HDR and normal photos as being duplicates was PhotoSweeper.  None of the other apps detected those two files as being duplicates as they look for file name as well as other attributes and the two files from the iPhone have diffferent file names.
    iPLM, however, is the best all around iPhoto utility as it can do so much more than just find duplicates.  IMO it's a must have tool if using iPhoto.
    OT

  • How to stop the automatic http to https switch on sicf

    Hi, all.
    I have enabled https on the ERP server. So http and https are running on different port. However, when I punch in the http url to start a web dynpro app from SICF, the sap server automatically switches the http url to https. Now the https connection works fine. But then I lost the capability to connect via http and there are requirements to connect to both ways. Can you please advise?
    Thanks
    Jonathan.
    Edited by: Jonathan Ma on Jun 1, 2011 9:20 PM

    Hi Trivedi
    This solution works for us:
    SICF---> Service --> Error Pages -> Logon Errors
    Click the "Configuration" button half-way down the page.
    Select "Define Service-Specific Settings" and then, under "Actions During Logon", set "Protocol" to "Do Not Switch".
    Cheers
    Marc
    *Note: Use global settings has no effect for us. even if the global settings are maintained correctly.

  • How to transfer the music from an Ipod touch to another one

    How can I transfer the music from an Ipod touch to another one

    Assuming you synced the contents to the first iPod Touch, you just plug the second iPod Touch into the same instance of iTunes and select to sync the music.  If your original iTunes library is on a hard drive which has failed, then restore that from your backup and follow the above procedures.

  • HT204053 how can i delete icloud e-mail address and create another one?

    i made a mistake when created the icloud e-mail address and want to replace that with some other icloud e-mail (not existing yet). how can i do that?

    You can't, without setting up a whole new iCloud account attached to another AppleID.
    You can setup an email alias instead: http://help.apple.com/icloud/#mm6b1a490a

  • How to maintain a field in a master taking from another one.

    Hi,
    I have a country field in my customer master. I need the same field in 0cust_sales also. Please anyone tell me how i can do the following requirement.
    Roma

    Hi,
    I am not sure whether I could understand your requirement or not....Correct me if my understanding is wrong..
    You are having Customer master data Infoobject which is having country as attribute.  You want to take value of country based on customer in to 0cust_sales ....
    Replicate your data source for 0custo_sales
    Edit 0cust_Sales and add info object country as an attribute
    save
    activate .
    Create Transformation
    Write an expert routine for country and populate the value from 0customer...
    BUT STILL I DONT UNDERSTAND WHAT IS USE OF DOING THIS ??? IS THERE ANY SPECIFIC REQUIREMENT ...!!!
    Thanks
    BVR

  • How can I shut off built in camera and use another one?

    I'm trying to use one of Apple's older auxillary cameras to shoot auditions.People will sit on the other side of my computer.
    I plug it into my Imac, but the system doesn't recognize it and I continue to see only
    myself. How can I turn the other camera on?

    harryfromrichardson wrote:
    ...the system doesn't recognize it ...
    How can I turn the other camera on?
    With the external (Firewire) iSight connected, (do not chain external iSight with other Firewire devices) if your  > System Profiler > Hardware > Firewire does not recognize the external iSight, use the suggestions here to test whether your old iSight is still functional:
    http://www.ralphjohns.co.uk/EZJim/EZJimpage4.html
    Once your system recognizes both cameras, be sure to rotate the ring at the front lens cover of the external iSight clockwise to turn it on and open the lens shutter.
    With more than one working camera recognized by your system, most camera-capable applications have settings that allow you to choose which camera to use. However, they do not all work the same way.  For example:
    • iMovie 9 ('11) uses a choices bar in the "Import from Camera" window:
    More info: http://docs.info.apple.com/article.html?path=iMovie/9.0/en/mov39f84285.html
    • For iChat, you can choose which iSight you use in the "Camera:" choices bar in iChat > Preferences... > Audio/Video that appears when more than one compatible camera is connected. Although your camera choices will be different, the choices bar will look something similar to the Preferences settings shown here:
    • Photo Booth uses the Photo Booth > Camera menu command to select which camera to use.  Remember, camera choice for any app will be available only if more than one working camera is recognized by your system.  With only one camera, the choices will not be visible.
    • For FaceTime,if your Mac recognizes more than one connected compatible camera, a "Camera" section listing the cameras from which you can choose will appear there. Clicking on the desired camera name will let you select the one you want as shown in this image from my Mac Pro and LED Cinema Display:
    If your Mac recognizes only one compatible camera, the "Camera" section will not appear in the Video menu, but FaceTime will automatically use the connected camera that is recognized by OS X.
    • QuickTimeX uses Preferences to select between connected cameras.
    QTX video Preference settings are visible only when you have a new video recording window open. The image below shows how to access QTX video Preferences from an open video recording window:
    Note that only one webcam (iSight) is shown in this image because I had only one camera connected to my Mac at the time. When more than one compatible camera is connected, you will see the additional camera name and can select it in this menu.
    •  For cameras connected via Flash browser plugins, control-click on an open video window and adjust the camera settings to select between a connected USB and Firewire video camera:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/help04.html
    • For other apps, check the app's menu items or Help to find out how to select between connected cameras.

  • How can you tell if your computer is synced w/ another one outside of your home?

    My husband moved out of the home and I think he has synced my computer with his girlfriend's. He has deleted his profile on my computer. How can I be sure he is not gaining access to info on my computer?

    You might want to have a computer professional or especially nerdy friend look at your PC, because some monitoring software is very hard to detect.
    If you use Firefox Sync, you might want to change your password.

  • How do i delete a account on icloud and set another one up on my mac book air

    I had my find my iphone id set at my iphone and mac and ipad, now i have changed them all except the mac. all the others are set and i would like my mac the same but dont see anywhere to delete it.
    <Email Edited by Host>

    Welcome to the Apple Community.
    System Preferences > iCloud.

  • How to return a list of Application Systems which share another one?

    Hi,
    In Designer 6 I have an application system which is shared by lots of other application systems. Is there an easy way to query the Designer metamodel to return such a list - I can't see which table(s) might hold this info.
    Trawling through the RON will take way too long and I might miss one.
    Thanks,
    Antony

    Roel,
    Thanks - of course, it's an object in the application system that is shared... but you knew what I meant!
    When I try to check this as per your post, I get the following error.
    "CDI-20902: No broadcast notification targets found in the registry." Designer help gives the following:
    Cause: Matrix diagrammer cannot find any diagrammer notification targets in the registry.
    Action: Reinstall product set or install entries into the registry from the install process.
    What does this mean - reinstalling Designer to get this to work?
    Thanks,
    Antony

  • How To Force User to Fulfill validations in view before switch to another view in infopath 2012

    i have a form with different views
    ,, every view has some validations ,, how to validate each view's validations before switching to another view
    if manual how to do that ?

    Hi Ahmed,
    You can use custom validation for verifying all the fields with required data, and write rule in you submit button to disable till all the fields are entered with valid data. Enabling submit or switch view rule after validation will help you on this regards.
    You can also use internal flags for enabling disabling submit button if required, or just make all the fields required OOTB.,
    I usuall use expressions to validate the form for values, this will help to check multiple fields atonce.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/39160c15-2074-4f27-b9bc-5b0a20d2d29e/validate-30-fields-on-infopath-form-before-swiching-view-or-submit-form-data
    here are some links for reference,
    http://office.microsoft.com/en-us/infopath-help/introduction-to-rules-HA010381865.aspx
    http://office.microsoft.com/en-us/infopath-help/add-rules-for-validation-HA101783369.aspx
    http://sharepoint-mattharmon.blogspot.com/2013/03/conditional-validation-rules-infopath.html
    http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

Maybe you are looking for

  • HT2311 boot freezing after itunes 10.7 update

    after installing nad rebooting my system with the new version of itunes. i get nothing but the grey apple screen and the wheel of eternity. whats the best way to handle this? running 10.7.(current) on 1,1 mac pro, ssd, and 10 gigs ram. i unplugged al

  • How to get LAST_DAY in obiee

    hi, i want exact syntax of this SQL query in obiee by using evaluate function? select last_day(add_months(sysdate,-1)) from dual..Can any one help me thanks, saichand.v

  • Problem installing adobe go live 6.0 - who can help?

    Hi... I have been using adobe go live for many years. A few weeks ago I cleaned up a bunch of old files to make more room on my harddrive and ever since then it is not responding any longer. I can't get into the program any more. I tried to reinstall

  • An issue while Configuring the Access System Console

    I'm facing a problem while Configuring the Access System Console. I have installed the policy manager, and when I try to configure the access system, an error message appears "The environment variable TEMP points to a directory that does not exist. T

  • Macbook Air 13inch 2014 or Macbook Pro 13 inch 2013?

    I need a new laptop for just high schooling(year 10) needs; I am not going to be running any graphic intensive programs. Mainly for internet use, notes and entertainment (I don't game much). I may need to edit some videos for my school; this shouldn'