So I have a video player with a playbar showing the current play time. I have added cue points like this:
code:
__VTODCuePoints = [
{time:3,name:"firstCue"},
{time:10,name:"secondCue"},
{time:20,name:"thirdCue"},
{time:35,name:"fourthCue"},
{time:40,name:"fifthCue"},
{time:67,name:"sixthCue"}
];
for (var i:Number = 0; i < __VTODCuePoints.length; i++)
{
v.addASCuePoint(__VTODCuePoints[i].time,__VTODCuePoints[i].name);
}
Now on the playbar, I want to place a little dot at the second of the cue point. I am doing this so far:
code:
private function addCuePointsToTimeline():void
{
for (var i:Number = 0; i < __VTODCuePoints.length; i++)
{
var sec:Number = __VTODCuePoints[i].time;
var cp:CuePointClip = new CuePointClip();
cp.mouseEnabled = false;
cp.y = 27;
cp.x = sec;
__big_timeline.addChild(cp);
}
}
Now that is placing them on the timeline which is good, however, cp.x is not right. It is placing the dots at the value of the time in the VTODCuePoint array. I need to figure out where they need to go relative to the width of the playbar. Its probably pretty simple, but I am blanking right now and cant think of it. Any ideas?