Progression URLObject yaimo forked:0favorite:0lines:35license : MIT License modified : 2009-07-13 16:58:01 Embed Tweet package { import flash.display.Sprite; import jp.nium.net.*; import flash.text.*; import jp.nium.external.*; public class FlashTest extends Sprite { private var textList:Array =[]; public function FlashTest() { var url:URLObject = new URLObject("http://asdoc.progression.jp/test.swf"); var url2:URLObject = new URLObject("http://localhost:8081/yaimo"); url.password = "password"; url.user = "me"; textinit(); textList[0].text = url.toString(); textList[1].text = url.host; textList[2].text = url.password; textList[3].text = url.url; textList[4].text = url.fileExtension; textList[5].text = ""+URLObject.validate("URLOBjectととはなんぞや"); textList[6].text = url.fileName; textList[7].text = url2.port; textList[8].text = url.user; //URLRequestでかえってくるのでとりあえずURLはURLObjectに入れとけば管理しやすいとか? textList[9].text = url.toURLRequest(); //Flash Player のコンテナを含むアプリケーション(通常はブラウザ)でウィンドウを開くか、置き換えます。 //コメントをはずすと指定URLに飛びます。 //user設定してあるとuserでログインしたりもできる。 //url.navigateTo("_blank"); //あとはデータベースと連動するときに役に立ちそうな予感(AIRとか) //指定URLに飛んだりするのが便利だった!! } public function textinit():void{ for(var i:int = 0; i<10;i++){ var text:TextField = new TextField(); text.width = 300; text.y = i*20; addChild(text); textList.push(text); } } } } Code Fullscreen Preview Fullscreen URLObject password user fileName URLObject.validate toURLRequest port host fileExtension url text toString width TextField push addChild Array Sprite int