在Flex/flash中嵌入Vimeo视频
是否可以在Flex中嵌入Vimeo视频?在Flex/flash中嵌入Vimeo视频
当我尝试在<mx:SWFLoader/>
中嵌入this link时,它不会出现任何内容。
回答:
我能做的最好的就是这个。使用Vimeo Api显示img并将img链接到视频。
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="black" >
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
import flash.net.URLRequest;
private var xml:XML = new XML();
private var loadXML:URLLoader = new URLLoader();
private function carregar(string:String):void{
//carregando XML adicionando o evento COMPLETE
loadXML.load(new URLRequest("http://vimeo.com/api/clip/"+string+".xml"));
loadXML.addEventListener(Event.COMPLETE, lista);
}
//função Listar
private function lista(event:Event):void {
xml = new XML(event.target.data);
img.source = xml.clip.thumbnail_large;
img.addEventListener(MouseEvent.CLICK, abrir);
}
private function abrir(event:MouseEvent):void{
var req:String = "http://vimeo.com/moogaloop.swf?clip_id="+xml.clip.clip_id;
var request:URLRequest = new URLRequest(req);
navigateToURL(request,"_blank");
}
]]>
</mx:Script>
<mx:TextInput x="209" y="55" width="182" id="codVimeo"/>
<mx:Button x="398" y="55" label="Carregar" click="carregar(codVimeo.text)"/>
<mx:Image x="113" y="94" width="361" height="318" id="img"/>
<mx:Label x="113" y="57" text="Código Vimeo:" color="#FFFFFF"/>
</mx:Application>
以上是 在Flex/flash中嵌入Vimeo视频 的全部内容, 来源链接: utcz.com/qa/264895.html