PDA

View Full Version : video captions : as cue pts : dyn txt


nyc10011
08-29-2007, 03:02 AM
Hello. I am new to this Forum and I am hoping someone could help me out. I am trying to display captions via AS over an FLVPlayback component. I have a dynamic text box (place_txt) on the stage that displays captions at specific cue points using a listener object.

The code I am using:

var listenerObject:Object = new Object();
listenerObject.cuePoint = function(cpObj:Object):Void {
place_txt.text = cpObj.info.name;
}
Player.addEventListener("cuePoint", listenerObject);

The code does display the captions. My question:
Is there a simple way to remove a dynamic text field after the last cue point is reached? I am trying to call a second .flv (without captions) through the same FLVPlayback component. I am new to AS and this has really been boggling me. I’m sure it’s probably quite simple to achieve using another event listener or something but I don't know the proper syntax.
I'd sincerely appreciate some feedback.
Thank you.

atomic
08-29-2007, 03:26 AM
You could try canceling out the listener on a last cue point (after your last legit one...), or simply set the textfield's text to place_txt.text = ""; or set it's alpha to 0.

nyc10011
08-30-2007, 05:18 AM
Atomic, thanks for the reply to my original post. However, I'm not quite sure what you are suggesting. When you say "canceling out the listener", do you mean "removeEventListener" after legit or using EventListener("complete", listenerObject);?

As I mentioned, I am trying to call a second .flv (without captions) through the same FLVPlayback component.

Also, wondering if you can be more specific with this suggestion...set the textfield's text to place_txt.text = ""; or set it's alpha to 0.

I am currently using this code in the listener...
place_txt.text = cpObj.info.name; to call captions from several cue points.

Perhaps the text field should be inside its own movie clip and not on the main stage? I'm not sure.

I'd really appreciate if you can elaborate a little more as I am still wet behind the ears when it comes to AS.

Thanks again for your help.

atomic
08-30-2007, 06:06 AM
Can you attach your .fla?

nyc10011
08-30-2007, 08:48 PM
atomic, .fla attached.

thanks for taking the time to look at it and
thanks for all your help.

nyc10011

atomic
08-30-2007, 10:16 PM
The easiest seems to just add another later cue point, and remove all text from the textfield, as...

var cuePt:Object = new Object();
cuePt.time = 11;
cuePt.name = "";
cuePt.type = "event";
the_Video.addASCuePoint(cuePt);