diff --git a/core/src/avm1/globals/movie_clip.rs b/core/src/avm1/globals/movie_clip.rs index 2572ce397..4c56c08ee 100644 --- a/core/src/avm1/globals/movie_clip.rs +++ b/core/src/avm1/globals/movie_clip.rs @@ -138,11 +138,8 @@ pub fn hit_test<'gc>( return Ok(ret.into()); } } else if args.len() == 1 { - let other = args - .get(0) - .unwrap() - .coerce_to_object(activation) - .as_display_object(); + let other = activation + .resolve_target_display_object(movie_clip.into(), args.get(0).unwrap().clone())?; if let Some(other) = other { return Ok(other .world_bounds() diff --git a/core/tests/swfs/avm1/movieclip_hittest/output.txt b/core/tests/swfs/avm1/movieclip_hittest/output.txt index 25ec4d6c9..771e6edc0 100644 --- a/core/tests/swfs/avm1/movieclip_hittest/output.txt +++ b/core/tests/swfs/avm1/movieclip_hittest/output.txt @@ -66,3 +66,15 @@ true // circle.hitTest(upper) true +// String path, below and to the right of the circle, overlapping only with BB. +// circle.hitTest('_root.lower') +true + +// String path, above and to the right of the circle. +// circle.hitTest('../upper') +true + +// String path, / +// circle.hitTest('/') +true + diff --git a/core/tests/swfs/avm1/movieclip_hittest/test.fla b/core/tests/swfs/avm1/movieclip_hittest/test.fla index 0f4d3e576..a4ee111b8 100644 Binary files a/core/tests/swfs/avm1/movieclip_hittest/test.fla and b/core/tests/swfs/avm1/movieclip_hittest/test.fla differ diff --git a/core/tests/swfs/avm1/movieclip_hittest/test.swf b/core/tests/swfs/avm1/movieclip_hittest/test.swf index f3e3975a3..97e4712d7 100644 Binary files a/core/tests/swfs/avm1/movieclip_hittest/test.swf and b/core/tests/swfs/avm1/movieclip_hittest/test.swf differ