as3程序主类,执行顺序
as3程序主类,执行顺序
View Code
package { import flash.display.Sprite; trace("C"); public class TestPackage extends Sprite { public function TestPackage(){ trace("G"); new TestPackage2; } trace("A"); } trace("D"); } trace("E"); class TestPackage2 { public function TestPackage2(){ trace("H"); } trace("B"); } trace("F");
输出:
A
B
C
D
E
F
G
H
why?