暂停
暂停(atTime:Number, suppressEvents:Boolean):self
暂停实例,可选地跳转到特定时间。
参数
atTime: 数值
(默认值 =
null
) - 实例在暂停前应该跳转到的时间(如果没有定义时间,它将在播放头当前所在的位置暂停)。suppressEvents:布尔值
默认值 =
true
) - 如果true
(默认),当播放头移动到由atTime
参数。
返回值:self
self(便于链式调用)
细节
暂停实例,可选地跳转到特定时间。
如果你定义了一个要跳转的时间(第一个参数,对于时间轴实例来说也可以是一个标签),播放头会立即跳转到该位置,并且如果播放头原来的位置和新时间之间有任何事件/回调,它们将不会被触发,因为默认情况下suppressEvents
(第二个参数)为true
。可以想象成像是将唱片机上的唱针提起并移动到新的位置,然后再放回唱片上。然而,如果你不希望在初始移动期间抑制这些事件/回调,请直接设置suppressEvents
以获取一个false
.
//pauses wherever the playhead currently is:
myAnimation.pause();
//jumps to exactly 2-seconds into the animation and then pauses:
myAnimation.pause(2);
//jumps to exactly 2-seconds into the animation and pauses but doesn't suppress events during the initial move:
myAnimation.pause(2, false);