我發現使用導出發行版導出時,我的項目無法正常工作。該錯誤非常小:用於移除視頻並卸載任何剩餘音頻的停止(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