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

URLRequestMethod 클래스는, URLRequest object가 POST 또는 GET 의 어느 쪽의 Methods를 사용하는지를 지정하는 값을 제공합니다.

View the examples

See also

URLRequest
URLVariables


Public property
 property정의
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
Public Methods
 Methods정의
 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
 InheritedtoString ():String
지정된 object의 string 표현을 돌려줍니다.
Object
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
Public 정수
 정수정의
  GET : String = "GET"
[static] URLRequest object가 GET 인 것을 지정합니다.
URLRequestMethod
  POST : String = "POST"
[static] URLRequest object가 POST 인 것을 지정합니다.
URLRequestMethod
정수의 상세
GET정수
public static const GET:String = "GET"

URLRequest object가 GET 인 것을 지정합니다.

POST정수 
public static const POST:String = "POST"

URLRequest object가 POST 인 것을 지정합니다.

Examples

다음의 예에서는, 로컬 텍스트 파일로 검출된 데이터를 로드해 표시합니다. 또, event 처리 정보도 출력합니다.

메모 : 이 예를 실행하려면 , example.txt (이)라는 이름의 파일을 SWF 파일과 같은 디렉토리에 배치합니다. 이 파일은, 몇개의 단어 또는 텍스트행을 포함한다 단순한 텍스트 파일입니다.

코드예에서는, 다음의 처리가 실행됩니다.

  1. constructor    함수는 loader 라고 하는 URLLoader 인스턴스를 작성합니다.
  2. loader object가 configureListeners() Methods에게 건네져 지원(support)되는 각 URLLoader 이벤트에 listener를 추가합니다.
  3. request 라고 하는 URLRequest 인스턴스가 작성됩니다. 이것은, 로드 되는 파일의 이름을 지정합니다.
  4. 요구의 method property는,URLRequestMethod.POST 로 설정됩니다.
  5. 다음에 request object가, 텍스트 파일을 로드하는 loader.load() 에게 건네집니다.
  6. URLLoader 에 의한 텍스트 파일의 로드가 종료하면,Event.COMPLETE 이벤트가 발생해, completeHandler() Methods가 방아쇠 됩니다. completeHandler() Methods는, 단순하게 텍스트 파일의 컨텐츠인 data property를 트레이스 합니다.


package {
    import flash.display.Sprite;
    import flash.events. *;
    import flash.net. *;

    public class URLRequestMethodExample extends Sprite {

        public function URLRequestMethodExample() {
            var loader:URLLoader = new URLLoader();
            configureListeners(loader);

            var request:URLRequest = new URLRequest("example.txt");
            
            request.method = URLRequestMethod.POST;
            loader.load(request);
        }

        private function configureListeners(dispatcher:IEventDispatcher) :void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event) :void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
        }

        private function openHandler(event:Event) :void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent) :void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent) :void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent) :void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent) :void {
            trace("ioErrorHandler: " + event);
        }
    }
}






 

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

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