我想以後的addChild追查在子視圖stage.name:Actionscript:如何獲取添加的孩子的階段屬性?
import flash.events.Event;
import flash.text.TextField;
public class TestView extends TextField {
public function TestView() {
addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
}
private function handleAddedToStage(event : Event) : void {
this.text = "TEXT ON TEXTFIELD";
trace("Stage is"+stage.name);
trace("Stage width"+stage.stageWidth);
}
}
stage.name已經overrided:在主營:
import flash.display.Sprite;
public class Main extends Sprite {
public function Main() {
addChild(new TestView());
}
override public function get name():String {
return "MAINSTAGE";
}
}
但在日誌中獲得零: 尾:FLASHLOG .TXT:文件截斷 舞臺ISNULL