Video and Audio Captions

Today, I was working on a Video and Audio CD that will accompany elementary and intermediate level language textbooks; and our instructors asked me to incorporate close caption to every video and audio exercise on the CD. So here is a simple example on how to read video/audio metadata:

<xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="">
            import mx.utils.ObjectUtil;

            private function getCuePoint(event:CuePointEvent):void {
                var cuePointObj:Object = null;
                var obj:Object;
                var cuePointArr:Array = videoDisplay.metadata.cuePoints;
                var idx:uint;
                var len:int = cuePointArr.length;
                for (idx = 0; idx < len; idx++) {
                    if (cuePointArr[idx].name == event.cuePointName) {
                        cuePointObj = cuePointArr[idx];
                trace(event.cuePointName, ObjectUtil.toString(cuePointObj));
    <mx:VideoDisplay id="videoDisplay"
            cuePoint="getCuePoint(event);" />

Enjoy, :)!