0
我試圖只在Flex中使用AS3構建項目。當我在flex中運行項目時,一切都很正常,但是當我導出發佈版本時,應該添加的圖像消失了。我很感激有人能幫助我。在導出發佈版本後,Flex Actionscript項目swf不工作
init();
public function init(loadedVideoCount:Number):void{
singleHolder=new singleVideoCont();
singleHolder.x=loadedVideoCount*singleHolder.width+2;
singleHolder.y=6;
singleHolder.buttonMode=true;
addChild(singleHolder);
this.addEventListener(MouseEvent.CLICK,onClick);
showTn();
}
private function showTn():void{
imgLoader = new Loader();
imgLoader.load(new URLRequest(_tnPath));
imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImgLoaded);
}
private function onImgLoaded(event:Event):void {
singleHolder.progBar.alpha = 0;
var image:Bitmap = imgLoader.contentLoaderInfo.content as Bitmap;
image.width=TN_WIDTH;
image.height=TN_HEIGHT;
image.x=3;
image.y=3;
singleHolder.addChild(image); //this line work when I run the project inside flex but the images are gone when I test my release build...
imgLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,onProgress);
imgLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,onImgLoaded);
//imgLoader = null;
}
您是否使用相對或絕對URL來識別這些圖片? – 2010-08-15 23:35:19
我從youtube搜索api中獲得了這些圖片。我假定它返回了一個http地址(url)。 – FlyingCat 2010-08-15 23:45:08