File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ impl<'gc> TDisplayObject<'gc> for MorphShape<'gc> {
119
119
if self . movie ( ) . is_action_script_3 ( ) && matches ! ( self . object2( ) , Avm2Value :: Null ) {
120
120
let class = context. avm2 . classes ( ) . morphshape ;
121
121
let object = Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , class) ;
122
+ // We don't need to call the initializer method, as AVM2 can't link
123
+ // a custom class to a MorphShape, and the initializer method for
124
+ // MorphShape itself is a no-op
122
125
self . set_object2 ( context, object. into ( ) ) ;
123
126
124
127
self . on_construction_complete ( context) ;
Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ impl<'gc> TDisplayObject<'gc> for Stage<'gc> {
766
766
767
767
// TODO: Replace this when we have a convenience method for constructing AVM2 native objects.
768
768
// TODO: We should only do this if the movie is actually an AVM2 movie.
769
- // This is necessary for EventDispatcher super-constructor to run.
769
+ // This is necessary for DisplayObject and EventDispatcher super-constructors to run.
770
770
let global_domain = context. avm2 . stage_domain ( ) ;
771
771
let mut activation = Avm2Activation :: from_domain ( context, global_domain) ;
772
772
let avm2_stage = Avm2StageObject :: for_display_object_childless (
Original file line number Diff line number Diff line change @@ -272,6 +272,9 @@ impl<'gc> TDisplayObject<'gc> for Text<'gc> {
272
272
if self . movie ( ) . is_action_script_3 ( ) {
273
273
let statictext = context. avm2 . classes ( ) . statictext ;
274
274
let object = Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , statictext) ;
275
+ // We don't need to call the initializer method, as AVM2 can't link
276
+ // a custom class to a StaticText, and the initializer method for
277
+ // StaticText itself is a no-op
275
278
self . set_object2 ( context, object. into ( ) ) ;
276
279
277
280
self . on_construction_complete ( context) ;
Original file line number Diff line number Diff line change @@ -451,6 +451,10 @@ impl<'gc> TDisplayObject<'gc> for Video<'gc> {
451
451
let video_constr = context. avm2 . classes ( ) . video ;
452
452
let object =
453
453
Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , video_constr) ;
454
+ // We don't need to call the initializer method, as AVM2 can't link
455
+ // a custom class to a Video, and the initializer method for Video
456
+ // itself only sets the size of the Video- the Video already has the
457
+ // correct size at this point.
454
458
455
459
self . set_object2 ( context, object. into ( ) ) ;
456
460
You can’t perform that action at this time.
0 commit comments