개발관련/flex
The navigateToURL() method syntax
후니의 개발이야기
2007. 8. 9. 16:12
728x90
반응형
navitageToURL()은 flash.net 패키지 내에 있는 메소드이다.
기본적인 사용법을 보면
navigateToURL(request:URLRequest, window:String):void
Value |
Description |
---|---|
_self |
Specifies the current frame in the current window. |
_blank |
Specifies a new window. This new window acts as a pop-up window in the client's browser, so you must be aware that a pop-up blocker could prevent it from loading. |
_parent |
Specifies the parent of the current frame. |
_top |
Specifies the top-level frame in the current window. |
window:String에 들어갈 부분의 파라미터는 위와같다.
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script><![CDATA[ import flash.net.*; public function executeSearch(event:MouseEvent):void { public var u:URLRequest = new URLRequest "http://www.google.com/search?hl=en&q=" + ta1.text); navigateToURL(u,"_blank"); } ]]></mx:Script> <mx:TextArea id="ta1"/> <mx:Button label="Search" click="executeSearch(event)"/> </mx:Application> 위의 예제는 이 메소드를 이용해서 get방식으로 값을 보내는 방식을
구현해본것이다
아울러 이것을 좀더 프로그램적으로 구현을 해본다면import flash.net.*; public var url:URLRequest = new URLRequest("http://mysite.com/index.jsp"); var uv:URLVariables = new URLVariables(); url.method = "GET"; uv.name = "fred"; url.data = uv; navigateToURL(url); 이런식으로 함수를 하나 만들어서 사용하면 될듯하다
플랙스에서 외부 asp나 jsp로 값을 보낼때 사용하면 유익할듯하다.
^^
다음엔 Datagrid에 이미지나 기타 다른 것들을 넣는것을 정리해서
올려놓을 예정이다.
728x90
반응형