Skip to content
Draft
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion core/src/display_object/movie_clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ pub struct MovieClipData<'gc> {

/// Show a hand cursor when the clip is in button mode.
avm2_use_hand_cursor: Cell<bool>,

queued_legacy_next_frame: Cell<bool>,
}

#[derive(Clone, Collect)]
Expand Down Expand Up @@ -247,6 +249,7 @@ impl<'gc> MovieClipData<'gc> {
attached_audio: Lock::new(None),
next_avm1_clip: Lock::new(None),
importer_movie: None,
queued_legacy_next_frame: Cell::new(false),
}
}

Expand Down Expand Up @@ -701,7 +704,13 @@ impl<'gc> MovieClip<'gc> {
}

pub fn next_frame(self, context: &mut UpdateContext<'gc>) {
if self.current_frame() < self.total_frames() {
let is_legacy_script_call = self.movie().version() < 10
&& self
.0
.contains_flag(MovieClipFlags::EXECUTING_AVM2_FRAME_SCRIPT);
if is_legacy_script_call && self.movie().is_action_script_3() {
self.0.queued_legacy_next_frame.set(true);
} else if self.current_frame() < self.total_frames() {
self.goto_frame(context, self.current_frame() + 1, true);
}
}
Expand Down Expand Up @@ -2239,6 +2248,13 @@ impl<'gc> MovieClip<'gc> {
if let Some(frame) = goto_frame {
self.run_goto(context, frame, false);
}
if self.0.queued_legacy_next_frame.take() {
let new_frame = self.current_frame() + 1;
if new_frame <= self.total_frames() {
self.run_goto(context, new_frame, false);
self.run_local_frame_scripts(context);
}
}
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/tests/swfs/timeline/events/fp9/test.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Test adapted from Shumway at https://github.com/mozilla/shumway/tree/master/test/swfs/timeline/events

num_frames = 4
known_failure = true # https://github.com/ruffle-rs/ruffle/issues/12141
Loading