我发现使用导出发行版导出时,我的项目无法正常工作。该错误非常小:用于移除视频并卸载任何剩余音频的停止(0)功能不起作用。导出发行版本无法正常工作
该文件在bin-debug文件夹中正常工作。只有在导出到发布文件夹时才会出现错误。我试图用bin-debug中的'correct'.swf文件与release文件夹中的文件进行swopping。这会导致“正确”文件失败。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" >
<mx:Script>
<![CDATA[
[Bindable] public var videoAddress:String
private static const YOUTUBE_EMBED_URL:String = "http://www.youtube.com/v/";
[Bindable] public var videoUrl:String = "";
public function play():void {
Security.allowDomain("*");
videoUrl = YOUTUBE_EMBED_URL+videoAddress;
}
public function stop():void{
SoundMixer.stopAll();
swfLoader.unloadAndStop(true)
}
public function playVideo(buttonNumber:int):void{
stop()
switch(buttonNumber){
case 0:
videoAddress = "xUWeAOLY0FU?rel=0";
play()
break;
case 1:
videoAddress = "m2dg6teC7fg?rel=0";
play()
break;
default:
break;
}
}
]]>
</mx:Script>
<mx:HBox>
<mx:Button id="button0" label="Button0" click="playVideo(0)" useHandCursor="true" buttonMode="true" />
<mx:Button id="button1" label="Button1" click="playVideo(1)" useHandCursor="true" buttonMode="true" />
</mx:HBox>
<mx:VBox id="vBox" y="50" />
<mx:SWFLoader id="swfLoader" source="{videoUrl}" y="50"/>
我怎样才能纠正这一错误?我想这可能是与跨域策略的问题,所以我增加了floowing文件到服务器,但它仍然不能正常工作: corssdomain.xml
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<site-control permitted-cross-domain-policies="by-content-type"/>
<allow-access-from domain="*"/>
<allow-access-from domain="i.ytimg.com"/>
<allow-access-from domain="youtube.com"/>
</cross-domain-policy>
什么是错误?你的代码是什么? – ketan 2015-02-06 04:22:32
导出发布文件的文件夹中的版本出现故障,但没有错误代码。 bin-debug文件夹中的版本正常工作,直到整个bin-debug文件夹被移动,此时它也会出现故障。 – SimonRH 2015-02-06 13:15:32
你是什么意思“无法正常工作”。除了你以外,任何人都不清楚。 – 2015-02-11 15:04:24