Hi Steve,

I'm actually just starting out my research into how to use Flash 8's embedded cuepoints to handle closed captioning. Needless to say, documentation is rather weak right now.

Below is my working code for displaying the captions that I embedded in the FLV file using the Flash 8 video encoder tool. It's not what you were looking for in terms of merging the captions from an XML file during runtime, but it does show how to get those captions while the video is playing.

The biggest confusion for me was linking the netstream with the video object. I did not realize that there is a new video object in Flash 8 and that's what you need to have on stage to display the video. Here is what the help docs say about creating a new video object:

To display the video stream, first place a Video object on the Stage. Then use Video.attachVideo() to attach the video stream to the Video object.

If the Library panel isn't visible, select Window > Library to display it. Add an embedded Video object to the library by clicking the Options menu on the right side of the Library panel title bar and selecting New Video. Drag the Video object to the Stage and use the Property inspector to give it a unique instance name, such as my_video. (Do not name it Video.)

/// BEGIN CODE
import mx.utils.Delegate
import mx.video.*

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
player.attachVideo(ns); // player is the video object (not an FLVPlayback) that I have on stage

ns.onCuePoint = Delegate.create(this, handleCuepoint);
ns.play("test.flv");

function handleCuepoint(infoObject:Object){
    captionText.text = infoObject.parameters.caption;
}

pauseButton.onPress = function(){
    ns.pause();
}
/// END CODE

Hope this helps, and please post any code you get to combine XML with FLV's at runtime, I am also looking in that direction.
Josh


On Oct 21, 2005, at 9:32 AM, Stephen Hueners wrote:

Given the potential utility of cupoints in general the supplied
documentation seems umm....lite.

To import cuepoint information from an XML file structured as:
... SNIP ...
I'd very much appreciate any direction in these documentary holes by anyone
able to address.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to