avm1: Exclude shape children from `StageObject::get_keys`

Non-interactive children such as shapes are not returned when
iterating over the keys of a stage object in AVM1.
This commit is contained in:
Mike Welsh 2023-04-05 13:04:39 -07:00
parent a38f74d989
commit 711a012fea
1 changed files with 6 additions and 1 deletions

View File

@ -328,7 +328,12 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
let mut keys = obj.base.get_keys(activation);
if let Some(ctr) = obj.display_object.as_container() {
keys.extend(ctr.iter_render_list().rev().map(|child| child.name()));
// Button/MovieClip children are included in key list.
for child in ctr.iter_render_list().rev() {
if child.as_interactive().is_some() {
keys.push(child.name());
}
}
}
keys