From 2751b89d4e5584c06156e1e073e3400baaf85dd8 Mon Sep 17 00:00:00 2001 From: Mike Welsh Date: Thu, 23 Jan 2020 18:04:48 -0800 Subject: [PATCH] avm1: Root clip should not have a name Previously we set the name of the root clip to `_level0`. Top-level clips should actually have no name (`_root._name` returns `""`). However, when constructing a dot path, `_level0` still gets inserted by `DisplayObject::path` for the top-level, so that `trace(_root)` still correctly prints `_level0`. TODO: When `loadMovieNum` gets merged in, the proper level # needs to be returned by `.DisplayObject::path`. --- core/src/display_object.rs | 3 ++- core/src/player.rs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/display_object.rs b/core/src/display_object.rs index 90b6b2f8c..1246fb533 100644 --- a/core/src/display_object.rs +++ b/core/src/display_object.rs @@ -575,7 +575,8 @@ pub trait TDisplayObject<'gc>: 'gc + Collect + Debug { path.push_str(&*self.name()); path } else { - self.name().to_string() + // TODO: Get the actual level # from somewhere. + "_level0".to_string() } } diff --git a/core/src/player.rs b/core/src/player.rs index 7e8c684cc..73851f56a 100644 --- a/core/src/player.rs +++ b/core/src/player.rs @@ -237,7 +237,6 @@ impl< let root_data = gc_root.0.write(gc_context); let mut root = root_data.root; root.post_instantiation(gc_context, root, root_data.avm.prototypes().movie_clip); - root.set_name(gc_context, "_level0"); }); player.build_matrices();