This page was saved using jaction on 2006-09-04 8:34:11.
Address: http://flexdocs.kr/docs/flex2/langref/flash/net/URLVariables.html
Title: flash.net.URLVariables (Flex™ 2 레퍼런스 가이드)  •  Size: 23236
Packageflash.net
Classpublic dynamic class URLVariables
InheritanceURLVariables Inheritance Object

URLVariables 클래스를 사용해, Flash® 어플리케이션과 서버의 사이에 변수를 전송 할 수 있습니다. URLVariables object는 URLLoader 클래스의 Methods, URLRequest 클래스의 data property, 및 flash.net 패키지 함수로 사용해 주세요.

View the examples

See also

URLLoader
외부 데이터의 조작


Public property
 property정의
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
Public Methods
 Methods정의
  URLVariables (source:String = null)
새로운 URLVariables object를 작성합니다.
URLVariables
  decode (source:String ):void
변수 string를, 지정된 URLVariables object의 property로 변환합니다.
URLVariables
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
  toString ():String
열거 가능한 변수를 모두 포함한 string를, MIME 컨텐츠 encode application/x-www-form-urlencoded 로 돌려줍니다.
URLVariables
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
constructor    의 상세
URLVariables()constructor   
public 함수 URLVariables(source:String = null)

새로운 URLVariables object를 작성합니다. URLVariables object를 URLRequest object의 data property에 건네줍니다.

string와 함께 URLVariables constructor    을 호출하면,decode() Methods가 자동적으로 불려 가, 그 string가 URLVariables object의 property에 변환됩니다.

Parameters
source:String (default = null) — 이름과 값의 페어를 포함한, URL encode 된 string입니다.
Methods의 상세
decode()Methods
public function decode(source:String ):void

변수 string를, 지정된 URLVariables object의 property로 변환합니다.

이 Methods는, URLVariables 이벤트에 의해 내부적으로 사용됩니다. 대부분의 경우, 유저가 직접 이 Methods를 호출할 필요는 없습니다.

Parameters
source:String — 이름과 값의 페어를 포함한, URL encode 된 쿠에리-string입니다.

Throws
Error — 소스 Parameters는, 이름과 값의 페어를 포함한, URL 인코딩 된 쿠에리-string가 아니면 안됩니다.

See also

toString()Methods 
public function toString():String

열거 가능한 변수를 모두 포함한 string를, MIME 컨텐츠 encode application/x-www-form-urlencoded 로 돌려줍니다.

반환값
String — 이름과 값의 페어를 포함한, URL encode 된 string입니다.
Examples

다음의 예에서는, 새로운 윈도우로 http://www. [yourDomain]. com/application.jsp 로 호스트 되는 리모트 어플리케이션을 열어, URLVariables object로 포착한 유저 세션에 관한 데이터를 어플리케이션에 건네줍니다.

이 예의 하이라이트는, 다음과 같습니다.

  1. constructor    함수는 request 라는 이름의, 리모트 어플리케이션의 URL 를 Parameters로서 취하는 URLRequest 인스턴스를 작성합니다.
  2. URLVariables object가 작성되어 그 2 개의 property에 값을 할당할 수 있습니다.
  3. URLVariables object가 URLRequest object의data property에 할당할 수 있습니다.
  4. 이 예에서는,navigateToURL 를 호출해, 새로운 브라우저 윈도우를 열어, 리모트 어플리케이션의 URL 에 접속합니다.

메모: 이 예를 실행하려면 , 이 예의 리모트 어플리케이션의 URL 를 실제의 URL 에 옮겨놓을 필요가 있습니다. 게다가 URLVariables object의 Flash Player 로 포착한 정보를 처리하기 위한 서버 코드가 필요합니다.

package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class URLVariablesExample extends Sprite {

        public function URLVariablesExample() {
            var url:String = "http://www. [yourDomain]. com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date(). getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            navigateToURL(request);
        }
    }
}






 

코멘트가 추가되었을 경우, 메일로 받기. | 코멘트 리포트

현재의 페이지: http://flexdocs.kr/docs/flex2/langref/flash/net/URLVariables.html