accessing an instance reference to the document class 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 usingstage.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.
精彩评论