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 @@ -111,6 +111,9 @@ impl<'gc> TDisplayObject<'gc> for MorphShape<'gc> {
111
111
if self . movie ( ) . is_action_script_3 ( ) && matches ! ( self . object2( ) , Avm2Value :: Null ) {
112
112
let class = context. avm2 . classes ( ) . morphshape ;
113
113
let object = Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , class) ;
114
+ // We don't need to call the initializer method, as AVM2 can't link
115
+ // a custom class to a MorphShape, and the initializer method for
116
+ // MorphShape itself is a no-op
114
117
self . set_object2 ( context, object. into ( ) ) ;
115
118
116
119
self . on_construction_complete ( context) ;
Original file line number Diff line number Diff line change @@ -780,7 +780,7 @@ impl<'gc> TDisplayObject<'gc> for Stage<'gc> {
780
780
781
781
// TODO: Replace this when we have a convenience method for constructing AVM2 native objects.
782
782
// TODO: We should only do this if the movie is actually an AVM2 movie.
783
- // This is necessary for EventDispatcher super-constructor to run.
783
+ // This is necessary for DisplayObject and EventDispatcher super-constructors to run.
784
784
let global_domain = context. avm2 . stage_domain ( ) ;
785
785
let mut activation = Avm2Activation :: from_domain ( context, global_domain) ;
786
786
let avm2_stage = Avm2StageObject :: for_display_object_childless (
Original file line number Diff line number Diff line change @@ -264,6 +264,9 @@ impl<'gc> TDisplayObject<'gc> for Text<'gc> {
264
264
if self . movie ( ) . is_action_script_3 ( ) {
265
265
let statictext = context. avm2 . classes ( ) . statictext ;
266
266
let object = Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , statictext) ;
267
+ // We don't need to call the initializer method, as AVM2 can't link
268
+ // a custom class to a StaticText, and the initializer method for
269
+ // StaticText itself is a no-op
267
270
self . set_object2 ( context, object. into ( ) ) ;
268
271
269
272
self . on_construction_complete ( context) ;
Original file line number Diff line number Diff line change @@ -443,6 +443,10 @@ impl<'gc> TDisplayObject<'gc> for Video<'gc> {
443
443
let video_constr = context. avm2 . classes ( ) . video ;
444
444
let object =
445
445
Avm2StageObject :: for_display_object ( context. gc ( ) , self . into ( ) , video_constr) ;
446
+ // We don't need to call the initializer method, as AVM2 can't link
447
+ // a custom class to a Video, and the initializer method for Video
448
+ // itself only sets the size of the Video- the Video already has the
449
+ // correct size at this point.
446
450
447
451
self . set_object2 ( context, object. into ( ) ) ;
448
452
You can’t perform that action at this time.
0 commit comments