我得到一个用于加载内容的 ActionScript 类:
公共类 LoaderContainer 扩展 Sprite {
public function LoaderExample() {
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
addChild(loader);
var request:URLRequest = new URLRequest("File://C:/1.swf");
loader.load(request);
}
private function completeHandler(event:Event):void {
Alert.show(this.x+"/"+this.y+"/"+this.width +"/"+ this.height);
}
}
然后将 LoaderContainer 添加到主 MXML 中的 Panel 控件中。
令我惊讶的是,LoaderContainer 的宽度/高度会根据它加载的内容一直在变化。
有什么方法可以限制内容的大小,使其符合容器的大小?
谢谢迈克尔