Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ function isAVM1MovieClip(obj): boolean {
obj instanceof AVM1MovieClip;
}

// Removing a movieclip should stop the execution of its actions immediately
function stopIfClipRemoved(ectx: ExecutionContext, clip: AVM1Object | AVM1Function) {
if (isAVM1MovieClip(clip) && clip.isGhost) {
console.log("Stopping actions for ghost clip");
ectx.isEndOfActions = true;
}
}

function as2GetType(v): string {
if (v === null) {
return 'null';
Expand Down Expand Up @@ -2233,6 +2241,7 @@ function avm1_callableHelper(ectx: ExecutionContext, obj: AVM1Object | AVM1Funct
}
frame.resetCallee();

stopIfClipRemoved(ectx, obj);
return { result, called };
}

Expand Down