패키지 | org.osmf.net |
클래스 | public dynamic class NetClient |
상속 | NetClient Proxy |
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Use this class to listen for callbacks on the NetConnection and NetStream created by a NetLoader's load operation.
Assign the value of the client
property of the NetConnection or NetStream
to an instance of the NetClient class.
Then use the NetClient's addHandler()
and removeHandler()
methods to register and unregister handlers for
the NetStream callbacks.
관련 API 요소
메서드 | 정의 주체 | ||
---|---|---|---|
Adds a handler for the specified callback name. | NetClient | ||
Removes a handler method for the specified callback name. | NetClient |
addHandler | () | 메서드 |
public function addHandler(name:String, handler:Function, priority:int = 0):void
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Adds a handler for the specified callback name.
If multiple handlers register for the same callback, the result of the callback is an array holding the results of each handler's invocation.
This example sets up handler for the onMetaData
callback.
function onMetaData(value:Object):void { trace("Got metadata."); } var stream:NetStream; var client:NetClient = (stream.client as NetClient); //assign the stream to the NetClient client.addHandler("onMetaData", onMetaData); //add the handler
매개 변수
name:String — Name of callback to handle.
| |
handler:Function — Handler to add.
| |
priority:int (default = 0 )
|
removeHandler | () | 메서드 |
public function removeHandler(name:String, handler:Function):void
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Removes a handler method for the specified callback name.
매개 변수
name:String — Name of callback for whose handler is being removed.
| |
handler:Function — Handler to remove.
|
Tue Jun 12 2018, 03:17 PM Z