Lib.current与Haxe显示列表

[11:11:18] <me> Who knows where and how to use Lib.current?
[11:13:20] <Herschel> ask away and someone will help 🙂
[11:20:30] <me> I found that I could not show Sprite in stage until I put them in Lib.current when I write AS3 code with HAXE.But what is it?Why I should put my Sprite in the Lib.current?
[11:21:10] <Herschel> flash.Lib.current is the root of the display list, in AS3 it would be root or your document class
[11:21:32] <Herschel> so, when you create a Sprite, it is not actually visible until you do flash.Lib.current.addChild( yourSprite )
[11:22:04] <Herschel> (or addChild it to some other parent that is already on the stage)
[11:23:45] <Herschel> At the start, your app is displaying: stage->Lib.current. To display something, you have to attach it to that tree. After addChild( yourSprite ), it becomes: stage->Lib.current->yourSprite
[11:26:31] <me> Thanks.So the Lib.current is equal to the document class?Why I can't see the Sprite that just use addchild in document class?
[11:28:16] <Herschel> If you do Lib.current.addChild( yourSprite ); yourSprite should be visible

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注