From 8c736b9756938d5e9d6279b136911377fd893e79 Mon Sep 17 00:00:00 2001 From: relrelb Date: Fri, 7 Jan 2022 17:41:47 +0200 Subject: [PATCH] avm1: Fix `MovieClipLoader` event arguments The first argument of all events is the target MovieClip. It was incorrect. Also, `onLoadComplete` accepts an additional `httpStatus` argument. Stub it to 0. --- core/src/loader.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/loader.rs b/core/src/loader.rs index b71920976..6e7e0df37 100644 --- a/core/src/loader.rs +++ b/core/src/loader.rs @@ -399,7 +399,7 @@ impl<'gc> Loader<'gc> { NEWEST_PLAYER_VERSION, uc, "broadcastMessage".into(), - &["onLoadStart".into(), Value::Object(broadcaster)], + &["onLoadStart".into(), clip.object()], ); } @@ -449,7 +449,7 @@ impl<'gc> Loader<'gc> { "broadcastMessage".into(), &[ "onLoadProgress".into(), - Value::Object(broadcaster), + clip.object(), length.into(), length.into(), ], @@ -484,7 +484,8 @@ impl<'gc> Loader<'gc> { NEWEST_PLAYER_VERSION, uc, "broadcastMessage".into(), - &["onLoadComplete".into(), Value::Object(broadcaster)], + // TODO: Pass an actual httpStatus argument instead of 0. + &["onLoadComplete".into(), clip.object(), 0.into()], ); } @@ -525,7 +526,7 @@ impl<'gc> Loader<'gc> { "broadcastMessage".into(), &[ "onLoadError".into(), - Value::Object(broadcaster), + clip.object(), "LoadNeverCompleted".into(), ], );