-

There is a loop/pause/resume trick you can use. Loop and pause the ActorInterval when you create it, then just resume and pause when the events are thrown

class panda(DirectObject):
    def __init__(self):
        self.model = Actor('panda', {'walk':'panda-walk'})
        self.model.reparentTo(render)
        self.walking = 0
        self.walkInterval = ActorInterval(self.model, 'walk')
        #loop and pause the animation from the beginning
        self.walkInterval.loop()
        self.walkInterval.pause()
        self.accept('arrow_up', self.playAnim)
        self.accept('arrow_up-up', self.pauseAnim)
        
    def playAnim(self):
        if self.walking == 0:
            #resume where you left off in the animation
            self.walkInterval.resume()
            self.walking = 1
            
    def pauseAnim(self):
        if self.walking == 1:
            #pause the animation in the current frame
            self.walkInterval.pause()
            self.walking = 0

This is the easiest way to do it. It is also possible to get and set the time of an interval( getT(), setT() ), which could lead to other possibilites.

A big thing to remember about ActorIntervals, is that when they are playing, the actor itself doesnt know that it is playing that animation. So something like self.model.getCurrentAnim() for the above would return None. There is a keyword argument forceUpdate in ActorInterval which should update the actor, but it doesnt seem to do anything in this respect. Maybe it does something else.