File tree Expand file tree Collapse file tree 5 files changed +38
-3
lines changed Expand file tree Collapse file tree 5 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 11//! Bitmap display object
22
3- use crate :: avm1;
3+ use crate :: avm1:: Object as Avm1Object ;
44use crate :: avm2:: {
55 Activation as Avm2Activation , BitmapDataObject as Avm2BitmapDataObject ,
66 ClassObject as Avm2ClassObject , FunctionArgs as Avm2FunctionArgs ,
@@ -312,13 +312,15 @@ impl<'gc> TDisplayObject<'gc> for Bitmap<'gc> {
312312 fn post_instantiation (
313313 self ,
314314 context : & mut UpdateContext < ' gc > ,
315- _init_object : Option < avm1 :: Object < ' gc > > ,
315+ _init_object : Option < Avm1Object < ' gc > > ,
316316 instantiated_by : Instantiator ,
317317 _run_frame : bool ,
318318 ) {
319319 let mc = context. gc ( ) ;
320320
321321 if self . movie ( ) . is_action_script_3 ( ) {
322+ self . set_default_instance_name ( context) ;
323+
322324 if !instantiated_by. is_avm ( ) {
323325 let bitmap_cls = self
324326 . avm2_bitmap_class ( )
Original file line number Diff line number Diff line change 1+ use crate :: avm1:: Object as Avm1Object ;
12use crate :: avm2:: Activation ;
23use crate :: avm2:: StageObject as Avm2StageObject ;
34use crate :: context:: RenderContext ;
@@ -11,6 +12,7 @@ use crate::prelude::*;
1112use crate :: display_object:: container:: ChildContainer ;
1213use crate :: display_object:: interactive:: InteractiveObjectBase ;
1314use crate :: tag_utils:: SwfMovie ;
15+ use crate :: vminterface:: Instantiator ;
1416use core:: fmt;
1517use gc_arena:: barrier:: unlock;
1618use gc_arena:: lock:: { Lock , RefLock } ;
@@ -117,6 +119,16 @@ impl<'gc> TDisplayObject<'gc> for LoaderDisplay<'gc> {
117119 }
118120 }
119121
122+ fn post_instantiation (
123+ self ,
124+ context : & mut UpdateContext < ' gc > ,
125+ _init_object : Option < Avm1Object < ' gc > > ,
126+ _instantiated_by : Instantiator ,
127+ _run_frame : bool ,
128+ ) {
129+ self . set_default_instance_name ( context) ;
130+ }
131+
120132 fn movie ( self ) -> Arc < SwfMovie > {
121133 self . 0 . movie . clone ( )
122134 }
Original file line number Diff line number Diff line change 1+ use crate :: avm1:: Object as Avm1Object ;
12use crate :: avm2:: StageObject as Avm2StageObject ;
23use crate :: context:: { RenderContext , UpdateContext } ;
34use crate :: display_object:: DisplayObjectBase ;
45use crate :: library:: { Library , MovieLibrarySource } ;
56use crate :: prelude:: * ;
67use crate :: tag_utils:: SwfMovie ;
8+ use crate :: vminterface:: Instantiator ;
79use core:: fmt;
810use gc_arena:: barrier:: unlock;
911use gc_arena:: lock:: Lock ;
@@ -151,6 +153,18 @@ impl<'gc> TDisplayObject<'gc> for MorphShape<'gc> {
151153 false
152154 }
153155
156+ fn post_instantiation (
157+ self ,
158+ context : & mut UpdateContext < ' gc > ,
159+ _init_object : Option < Avm1Object < ' gc > > ,
160+ _instantiated_by : Instantiator ,
161+ _run_frame : bool ,
162+ ) {
163+ if self . movie ( ) . is_action_script_3 ( ) {
164+ self . set_default_instance_name ( context) ;
165+ }
166+ }
167+
154168 fn movie ( self ) -> Arc < SwfMovie > {
155169 self . 0 . shared . get ( ) . movie . clone ( )
156170 }
Original file line number Diff line number Diff line change 1+ use crate :: avm1:: Object as Avm1Object ;
12use crate :: avm2:: StageObject as Avm2StageObject ;
23use crate :: context:: { RenderContext , UpdateContext } ;
34use crate :: display_object:: DisplayObjectBase ;
@@ -257,11 +258,13 @@ impl<'gc> TDisplayObject<'gc> for Text<'gc> {
257258 fn post_instantiation (
258259 self ,
259260 context : & mut UpdateContext < ' gc > ,
260- _init_object : Option < crate :: avm1 :: Object < ' gc > > ,
261+ _init_object : Option < Avm1Object < ' gc > > ,
261262 _instantiated_by : Instantiator ,
262263 _run_frame : bool ,
263264 ) {
264265 if self . movie ( ) . is_action_script_3 ( ) {
266+ self . set_default_instance_name ( context) ;
267+
265268 let statictext = context. avm2 . classes ( ) . statictext ;
266269 let object = Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , statictext) ;
267270 // We don't need to call the initializer method, as AVM2 can't link
Original file line number Diff line number Diff line change @@ -360,6 +360,10 @@ impl<'gc> TDisplayObject<'gc> for Video<'gc> {
360360 _instantiated_by : Instantiator ,
361361 _run_frame : bool ,
362362 ) {
363+ if self . movie ( ) . is_action_script_3 ( ) {
364+ self . set_default_instance_name ( context) ;
365+ }
366+
363367 let movie = self . 0 . movie . clone ( ) ;
364368
365369 let ( stream, keyframes) = match self . 0 . source . get ( ) {
You can’t perform that action at this time.
0 commit comments