Skip to content

Commit

Permalink
Fixed two bugs in KSSequenceGroup
Browse files Browse the repository at this point in the history
git-svn-id: https://kitchensynclib.googlecode.com/svn/trunk@545 6a906af3-0c40-0410-b003-45319c8c72c3
  • Loading branch information
mimshwright committed Jun 12, 2010
1 parent a399c91 commit ab401cc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/org/as3lib/kitchensync/action/group/KSSequenceGroup.as
Expand Up @@ -130,7 +130,7 @@ package org.as3lib.kitchensync.action.group
* After the Sequence starts running, it no longer needs to listen to updates so it unregisters.
*/
override public function update(currentTime:int):void {
if (startTimeHasElapsed(currentTime)) {
if (startTimeHasElapsed(currentTime) && _currentAction == null) {
startNextAction();
// Sequence no longer needs to listen for events from Synchronizer
// since it now receives all cues from its children.
Expand Down Expand Up @@ -165,11 +165,24 @@ package org.as3lib.kitchensync.action.group
super.onChildFinished(event);
_currentAction.removeEventListener(KitchenSyncEvent.ACTION_COMPLETE, onChildFinished);
_currentAction.removeEventListener(KitchenSyncEvent.ACTION_START, onChildStart);

if (isPaused) return;
completeOrStartNextAction();
}

protected function completeOrStartNextAction():void {
if (!checkForComplete()) {
startNextAction();
} else {
complete();
}
}

override public function unpause():void {
super.unpause();
if (!currentAction.isRunning) {
completeOrStartNextAction();
}
}

/**
Expand Down

0 comments on commit ab401cc

Please sign in to comment.