topical media & game development
student-mashup-youtube-components-FLVConstructor2.mx
student-mashup-youtube-components-FLVConstructor2.mx
[swf]
flex
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onAppCreationComplete ()"
>
<mx:Script>
<![CDATA[
import flash.net.*;
import flash.events.*;
import flash.display.*;
//private var loader:Loader;
private var abortId:uint;
[Bindable] public var inputURL:String;
[Bindable] public var resultURL:String;
private function onAppCreationComplete ():void
{
//loader = new Loader ();
}
public function startLoadingOud ():void
{
var req:URLRequest = new URLRequest (inputURL);
//loader.contentLoaderInfo.addEventListener(Event.INIT, handlerLoaderInit);
//loader.load(req);
}
public function startLoading ():void
{
var url:URL = new URL(inputURL);
var urlVars:URLVariables = new URLVariables ();
urlVars.decode (url.split("?")[1]);
var flvURL:String = constructFLVURL (urlVars.video_id, urlVars.t);
resultURL=flvURL;
//loader.unload();
}
private function constructFLVURL (video_id:String, t:String):String
{
var str:String = "http://www.youtube.com/get_video.php?";
str += "video_id=" + video_id;
str += "&t=" + t;
return str;
}
/*
private function logMessage (message:String):void
{
outputText.text += message + "\n";
trace (message);
}
*/
]]>
</mx:Script>
<!--
<mx:VBox height="100%" width="100%">
<mx:Label text="Output:-"/>
<mx:TextArea id="outputText" width="100%" height="100%"/>
</mx:VBox> -->
</mx:VBox>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.