User Guide
574 FLVPlayback Component (Flash Professional Only)
FLVPlayback.close
Availability
Flash Player 8.
Edition
Flash Professional 8.
Usage
var listenerObject:Object = new Object();
listenerObject.close = function(eventObject:Object):Void {
// insert event-handling code here
};
my_FLVplybk.addEventListener("close", listenerObject);
Description
Event; the FLVPlayback instance dispatches this event when it closes the NetConnection, by
timing out or through a call to the
closeVideoPlayer() method, or when you call the
load() method or the play() method or set contentPath and cause the RTMP connection
to close as a result. The FLVPlayback instance dispatches this event only when streaming from
FCS or FVSS. The event object has the properties
state and playheadTime.
Event has property
vp, which is the index number of the video player to which this
event applies.
Example
The following example assumes playing a streaming FLV file from a FCS or FVSS. When the
FLV file completes, a listener for the
complete event sets the contentPath property to the
location of a new FLV file, which triggers a
close event on the RTMP connection for the first
FLV file. The listener for the
close event displays the index number of the video player for
which the event occurred.
Drag an FLVPlayback component to the Stage, and give it an instance name of
my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the
Timeline. In the statement that loads the
contentPath property, replace the italicized text
with the name and location of an FLV file on your FCS.
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
var listenerObject:Object = new Object();
// listen for close event on RTMP connection; display index of video player
listenerObject.close = function(eventObject:Object) {