This page was saved using jaction on 2006-09-04 8:33:59.
Address: http://flexdocs.kr/docs/flex2/langref/flash/events/ProgressEvent.html
Title: flash.events.ProgressEvent (Flex™ 2 레퍼런스 가이드)  •  Size: 58280
Packageflash.events
Classpublic class ProgressEvent
InheritanceProgressEvent Inheritance Event Inheritance Object
SubclassesRSLEvent

로드 조작이 개시하는지, 소켓이 데이터를 수신하면, Flash® Player 에 의해 ProgressEvent object가 dispatch됩니다. 이러한 이벤트는, 통상, SWF 파일, 이미지, 또는 데이터가 Flash Player 에 로드 될 때 생성됩니다. ProgressEvent.PROGRESSProgressEvent.SOCKET_DATA 의 2 종류의 progress 이벤트가 있습니다.

View the examples

See also

LoaderInfo class
Socket class


Public property
 property정의
 Inheritedbubbles : Boolean
이벤트가 바브 링 이벤트인 가 어떤가를 나타냅니다.
Event
  bytesLoaded : uint
listener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.
ProgressEvent
  bytesTotal : uint
로드 프로세스가 성공했을 경우에 로드 되는 아이템 또는 바이트의 총수입니다.
ProgressEvent
 Inheritedcancelable : Boolean
이벤트에 관련지을 수 있었던 행동을 회피할 수 있을지 어떨지를 나타냅니다.
Event
 Inheritedconstructor : Object
특정의 object 인스턴스의 클래스 object 또는 constructor    함수에의 참조입니다.
Object
 InheritedcurrentTarget : Object
event listener로 Event object를 액티브하게 처리하고 있는 object입니다.
Event
 InheritedeventPhase : uint
event 플로우(flow)의 현재의 단계입니다.
Event
 Inheritedprototype : Object
[static] 클래스 또는 함수 object의 prototype object에의 참조입니다.
Object
 Inheritedtarget : Object
event 타겟입니다.
Event
 Inheritedtype : String
이벤트의 형태입니다.
Event
Public Methods
 Methods정의
  ProgressEvent (type:String , bubbles:Boolean = false, cancelable:Boolean = false, bytesLoaded:uint = 0, bytesTotal:uint = 0)
progress 이벤트에 관한 정보를 포함한 Event object를 작성합니다.
ProgressEvent
  clone ():Event
ProgressEvent object의 복사를 작성해, 각 property의 값을 원의 property의 값과 일치하도록(듯이) 설정합니다.
ProgressEvent
 InheritedformatToString (className:String , ... arguments):String
custom Event 클래스에 toString() Methods를 Implements하기 위한 유틸리티 함수입니다.
Event
 InheritedhasOwnProperty (name:String ):Boolean
object로 지정된 property가 정의되고 있는지 어떤지를 나타냅니다.
Object
 InheritedisDefaultPrevented ():Boolean
이벤트로 preventDefault() 가 불려 갔는지 어떠했는지를 체크합니다.
Event
 InheritedisPrototypeOf (theClass:Object ):Boolean
Object 클래스의 인스턴스가, Parameters로서 지정된 object의 prototype 체인내에 있을지 어떨지를 나타냅니다.
Object
 InheritedpreventDefault ():void
이벤트의 디폴트 행동을 캔슬할 수 있는 경우에, 그 행동을 캔슬합니다.
Event
 InheritedpropertyIsEnumerable (name:String ):Boolean
지정된 property가 존재해, 열거 가능한가 어떤가를 나타냅니다.
Object
 InheritedsetPropertyIsEnumerable (name:String , isEnum:Boolean = true):void
루프 처리에 대한 다이나믹 property의 가용성을 설정합니다.
Object
 InheritedstopImmediatePropagation ():void
event 플로우(flow)의 현재의 노드 및 후속 하는 노드로, event listener가 처리되지 않게 합니다.
Event
 InheritedstopPropagation ():void
event 플로우(flow)의 현재의 노드에 후속 하는 노드로, event listener가 처리되지 않게 합니다.
Event
  toString ():String
ProgressEvent object의 모든 property를 포함한 string를 돌려줍니다.
ProgressEvent
 InheritedvalueOf ():Object
지정된 object의 원시적치를 돌려줍니다.
Object
Public 정수
 정수정의
 InheritedACTIVATE : String = "activate"
[static] activate event object의 type property의 값을 정의합니다.
Event
 InheritedADDED : String = "added"
[static] added event object의 type property의 값을 정의합니다.
Event
 InheritedCANCEL : String = "cancel"
[static] cancelevent object의 type property의 값을 정의합니다.
Event
 InheritedCHANGE : String = "change"
[static] change event object의 type property의 값을 정의합니다.
Event
 InheritedCLOSE : String = "close"
[static] close event object의 type property의 값을 정의합니다.
Event
 InheritedCOMPLETE : String = "complete"
[static] complete event object의 type property의 값을 정의합니다.
Event
 InheritedCONNECT : String = "connect"
[static] connect event object의 type property의 값을 정의합니다.
Event
 InheritedDEACTIVATE : String = "deactivate"
[static] deactivate event object의 type property의 값을 정의합니다.
Event
 InheritedENTER_FRAME : String = "enterFrame"
[static] enterFrame event object의 type property의 값을 정의합니다.
Event
 InheritedID3 : String = "id3"
[static] id3 event object의 type property의 값을 정의합니다.
Event
 InheritedINIT : String = "init"
[static] init event object의 type property의 값을 정의합니다.
Event
 InheritedMOUSE_LEAVE : String = "mouseLeave"
[static] mouseLeave event object의 type property의 값을 정의합니다.
Event
 InheritedOPEN : String = "open"
[static] open event object의 type property의 값을 정의합니다.
Event
  PROGRESS : String = "progress"
[static] progress event object의 type property의 값을 정의합니다.
ProgressEvent
 InheritedREMOVED : String = "removed"
[static] removed event object의 type property의 값을 정의합니다.
Event
 InheritedRENDER : String = "render"
[static] render event object의 type property의 값을 정의합니다.
Event
 InheritedRESIZE : String = "resize"
[static] resize event object의 type property의 값을 정의합니다.
Event
 InheritedSCROLL : String = "scroll"
[static] scroll event object의 type property의 값을 정의합니다.
Event
 InheritedSELECT : String = "select"
[static] select event object의 type property의 값을 정의합니다.
Event
  SOCKET_DATA : String = "socketData"
[static] socketData event object의 type property의 값을 정의합니다.
ProgressEvent
 InheritedSOUND_COMPLETE : String = "soundComplete"
[static] soundComplete event object의 type property의 값을 정의합니다.
Event
 InheritedTAB_CHILDREN_CHANGE : String = "tabChildrenChange"
[static] tabChildrenChange event object의 type property의 값을 정의합니다.
Event
 InheritedTAB_ENABLED_CHANGE : String = "tabEnabledChange"
[static] tabEnabledChange event object의 type property의 값을 정의합니다.
Event
 InheritedTAB_INDEX_CHANGE : String = "tabIndexChange"
[static] tabIndexChange event object의 type property의 값을 정의합니다.
Event
 InheritedUNLOAD : String = "unload"
[static] unload event object의 type property의 값을 정의합니다.
Event
property의 상세
bytesLoadedproperty
bytesLoaded:uint   [read-write]

listener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.

Implements
    public function get bytesLoaded():uint
    public function set bytesLoaded(value:uint ):void
bytesTotalproperty 
bytesTotal:uint   [read-write]

로드 프로세스가 성공했을 경우에 로드 되는 아이템 또는 바이트의 총수입니다.

Implements
    public function get bytesTotal():uint
    public function set bytesTotal(value:uint ):void
constructor    의 상세
ProgressEvent()constructor   
public 함수 ProgressEvent(type:String , bubbles:Boolean = false, cancelable:Boolean = false, bytesLoaded:uint = 0, bytesTotal:uint = 0)

progress 이벤트에 관한 정보를 포함한 Event object를 작성합니다. event listener에게는 Event object가 Parameters로서 건네받습니다.

Parameters
type:String — 이벤트의 타입입니다. 유효한 값은,ProgressEvent.PROGRESSProgressEvent.SOCKET_DATA 입니다.
 
bubbles:Boolean (default = false) — Event object가 event 플로우(flow)의 바브 링 단계에서 처리될지 어떨지를 판단합니다.
 
cancelable:Boolean (default = false) — Event object가 캔슬 가능한가 어떤가를 판단합니다.
 
bytesLoaded:uint (default = 0) — listener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.
 
bytesTotal:uint (default = 0) — 로드 프로세스가 성공했을 경우에 로드 되는 아이템 또는 바이트의 총수입니다.
Methods의 상세
clone()Methods
public override function clone():Event

ProgressEvent object의 복사를 작성해, 각 property의 값을 원의 property의 값과 일치하도록(듯이) 설정합니다.

반환값
Event — 원의 object와 같은 property치를 포함한 새로운 ProgressEvent object입니다.
toString()Methods 
public override function toString():String

ProgressEvent object의 모든 property를 포함한 string를 돌려줍니다. string는 다음의 형식입니다.

[ProgressEvent type=value bubbles=value cancelable=value bytesLoaded=value bytesTotal=value]

반환값
String ProgressEvent object의 모든 property를 포함한 string입니다.
정수의 상세
PROGRESS정수
public static const PROGRESS:String = "progress"

progress event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
bytesLoadedlistener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.
bytesTotal로드 프로세스가 성공했을 경우에 최종적으로 로드 되는 아이템 또는 바이트의 총수입니다.
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetevent listener로 Event object를 액티브하게 처리하고 있는 object입니다.
target진행 상황을 리포트하는 네트워크 object입니다.

See also

SOCKET_DATA정수 
public static const SOCKET_DATA:String = "socketData"

socketData event object의 type property의 값을 정의합니다.

이 이벤트에는, 다음의 property가 있습니다.

PropertyValue
bubblesfalse
cancelablefalse 는, 캔슬하는 디폴트의 동작이 없는 것을 나타냅니다.
currentTargetEvent 를 액티브하게 처리하고 있는 object입니다.
bytesLoadedlistener가 이벤트를 처리하고 있을 때 로드 된 아이템수 또는 바이트수입니다.
bytesTotal0. 이 property는,socketData event object에 의해 사용되지 않습니다.
target진행 상황을 리포트하는 Socket object입니다.

See also

Examples

다음의 예에서는,ProgressEventExample 클래스를 사용해, 파일의 다운로드중에 다양한 event listener를 사용하는 방법을 나타냅니다. 이 예에서는, 다음의 처리를 실행합니다.
  1. property downloadURLfileName 가 작성됩니다. 이것들은 다운로드 파일의 장소와 이름을 나타냅니다.
  2. ProgressEventExample constructor    에서는,file 라는 이름의 새로운 FileReference object가 작성되어,configureListeners() Methods에게 건네집니다.
  3. 다음에,downloadURL property 및fileName property가 file.download() 에게 건네집니다. 이것에 의해, 파일을 다운로드하는 장소의 지정이 요구됩니다.
  4. configureListeners() Methods는, 7 개의 event listener와 거기에 관련하는 subscribers Methods를 추가합니다.
    1. cancel/cancelHandler() 는, 파일의 다운로드가 캔슬되었을 경우에 dispatch됩니다.
    2. complete/complereHandler() 는, 파일의 다운로드 프로세스가 종료했을 때에 dispatch됩니다.
    3. ioError/ioErrorHandler() 는, 다운로드 파일을 사용할 수 없는 경우, 또는 액세스 할 수 없는 경우에 dispatch됩니다.
    4. open/openHandler() 는, 다운로드 조작이 개시했을 때에 dispatch됩니다.
    5. progress/progressHandler() 는, 다운로드 프로세스가 개시했을 때와 종료했을 때에 dispatch됩니다.
    6. securityError/securityErrorHandler 는, 로컬 재생의 시큐러티 설정이 다운로드 파일의 데이터 액세스의 종류와 일치하지 않는 경우에 dispatch됩니다 (로컬과 네트워크의 차이). 이 후의 「설명」을 참조해 주세요.
    7. select/selectHandler() 는, 다운로드 object가 선택되었을 때에 dispatch됩니다.

메모 :


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

    public class ProgressEventExample extends Sprite {
        private var downloadURL:String = "http://www. [yourDomain]. com/SomeFile.pdf";
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function ProgressEventExample() {
            var request:URLRequest = new URLRequest(downloadURL);
            file = new FileReference();
            configureListeners(file);
            file.download(request, fileName);
        }

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

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

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

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

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

        private function progressHandler(event:ProgressEvent) :void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler: name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

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

        private function selectHandler(event:Event) :void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + downloadURL);
        }
    }
}






 

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

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