Yes, you use action script "listeners". Just do a search for that and you'll find the information and tutorials you need.
Also if you are streaming FLV's you can add cuepoints to the FLV's during encoding. That actually makes the action script much easier because the cuepoints are already embedded in the movie, but you can still use listeners without the embedded cuepoints.
Here's an example of one I made that listens for the end of the movie and then returns to the beginning to replay. The cuepoint "endLoop" is embedded at the end of the FLV. my_FLVPlybk is the instance name of the FLVPlayback component.
stop();
import mx.video.*;
var listenerObject1:Object = new Object();
listenerObject1.cuePoint = function(eventObject:Object):Void {
var cuePtName = eventObject.info.name;
if (cuePtName == "endLoop") {
my_FLVPlybk.seekToNavCuePoint(0);
//trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
//trace("Cue point name is: " + eventObject.info.name);
//trace("Cue point type is: " + eventObject.info.type);
}
};
my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
- stop();
- import mx.video.*;
- var listenerObject1:Object = new Object();
- listenerObject1.cuePoint = function(eventObject:Object):Void {
- var cuePtName = eventObject.info.name;
- if (cuePtName == "endLoop") {
- my_FLVPlybk.seekToNavCuePoint(0);
-
- //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
- //trace("Cue point name is: " + eventObject.info.name);
- //trace("Cue point type is: " + eventObject.info.type);
- }
- };
- my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.