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?

posted @ 2012-04-19 23:37  jinc  阅读(482)  评论(2编辑  收藏  举报