我用Loader加載了一個外部的swf文件,並嘗試在一個固定的區域顯示它,就像一個固定的尺寸精靈對象。而且我不知道swf文件的確切大小,我只是希望它適合固定區域。那可能嗎?如何在Actionscript項目中更改外部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到適合面板的面積。我怎樣才能做到這一點?
仍然沒有工作,所以我懷疑,如果這是一個不可能的任務。 或者我們不能使用這種常規武器... – user198816 2009-11-18 01:11:44