Loader を使用して外部の swf ファイルをロードし、固定次元のスプライト オブジェクトのように固定領域に表示しようとしました。そして、swf ファイルの正確なサイズはわかりません。固定領域に収まるようにしたいだけです。それは可能ですか?
コード:
var loader:Loader = new Loader();
loader.load(new URLRequest("some path"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(e:Event):void
{
var loaderinfo:LoaderInfo = event.target as LoaderInfo;
loaderinfo.content.width = 300;
loaderinfo.content.height = 300;
loaderinfo.content.x = 0;
loaderinfo.content.y = 0;//note that this works for displaying picture, but not for swf
thePanel.stage.addChild(loader);
}
swfをパネルの領域に合わせたいです。これどうやってするの?