开发者

accessing an instance reference to the document class from the stage's timeline

开发者 https://www.devze.com 2022-12-14 22:11 出处:网络
Is there a way to get an instance refer开发者_开发技巧ence to the document class to call a method of it from the stage\'s timeline?

Is there a way to get an instance refer开发者_开发技巧ence to the document class to call a method of it from the stage's timeline?

I see that here's a possible solution: using a singleton

Other solution I though of is using stage.getChildAt( 0 ) but it's not very nice.

Is there an 'official' instance reference? because the document class is obviously instantiated at startup, but is that instance accessible in any way without having to use a custom solution like the ones mentioned?

Thanks.


All attached DisplayObject instances have a root property. Cast this to your document class. Bingo.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号