PDA

View Full Version : [AS2] Cs4 FLV Cue point


InTheCity
12-02-2008, 08:28 PM
I'm not using the import mx.video.*; method to talk to my flv

What would I change here to listen out for a cue point, that triggers an event?

var listener:Object = new Object();
listener.complete = function(evt:Object):Void {
trace("ball");
gotoAndPlay("cuebouncing");
trace(evt.state);
trace(evt.playheadTime);

}
MyTest_flv.addEventListener("complete", listener);

CyanBlue
12-02-2008, 08:30 PM
Um, isn't there NetStream.onCuePoint handler you can use just for that???

InTheCity
12-02-2008, 08:36 PM
I don't know. I was told I wasn't using the Netstream way of utilizing FLV's
I'm very new to this and have gotten through a lot of code without understanding much of it.

Could you provide a quick example that basically says oncuepoint.ball, gotoandplay("bouncingball")

CyanBlue
12-02-2008, 08:45 PM
Well... Check out the onCuePoint in the Flash manual... It's got a working sample code that you can use... ;)

InTheCity
12-02-2008, 08:48 PM
Everything I've searched is for Netsream and not the flv component.

CyanBlue
12-02-2008, 08:49 PM
Um... What are you using to display the video???

InTheCity
12-02-2008, 08:51 PM
The FLV component

InTheCity
12-02-2008, 08:54 PM
Don't worry about it.
I have it..

stop();
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
trace("mycue: " + eventObject.info.name);
trace("Cue point type is: " + eventObject.info.type);
gotoAndPlay("trigger");
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);

Why is all of that ns.stream.import crap even necessary?

CyanBlue
12-02-2008, 08:56 PM
FLVPlayback.cuePoint is what you are looking for then...
The sample code in this help file should get you going...
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003003.html

Also, I did a quick google and found this one...
http://board.flashkit.com/board/showthread.php?t=661341

InTheCity
12-03-2008, 07:34 PM
Thanks