title: Actionscript 2: Event Cue Points: findNearestCuePoint
body: <p>Hello everyone and anyone!</p>
  
  <p>Ok... I have been banging my head against the wall with this issue for literally weeks, but I still cannot find an answer that has successfully resolved the issue.</p>
  
  <p>I created an FLA and placed a FLV component with the instance name of videoPlay on the stage.</p>
  
  <p>videoPlay is pathed to a streaming FLV with embedded event cue points. The cue points are numbered sequentially from narration1 to narration16.</p>
  
  <p>I established a listener object: </p>
  
  <pre><code>     var videoPlayCuePointListener:Object = new Object();
  </code></pre>
  
  <p>The event listener for the cue points:</p>
  
  <pre><code>   videoPlayCuePointListener.cuePoint = function(eventObject:Object):Void{
     if(eventObject.info.name == "narration1"){_root.cc_box.cc_txt.htmlText = cueTxt1);}
     else if(eventObject.info.name == "narration2"){_root.cc_box.cc_txt.htmlText = cueTxt2);}
     etc, through narration16 }
  </code></pre>
  
  <p>and so on through narration16.</p>
  
  <p>Then I attached the event listener to the FLV component on stage:</p>
  
  <pre><code>   videoPlay.addEventListener("cuePoint", videoPlayCuePointListener);
  </code></pre>
  
  <p>All of this works very well. As the FLV plays, each event cue point fires off the correct text to the cc_txt dynamic text box.</p>
  
  <p>The issue I am having is that I cannot find the nearest cue point to the FLV playhead so that I can fire events when the user scrubs the timeline.</p>
  
  <p>I have researched this as thoroughly as I possibly could before finally deciding to post the issue, but although the documentation and various postings regarding findNearestCuePoint discovered throughout the web have provided numerous examples, not a single one has been successful.</p>
  
  <p>I have attempted to add a listener to videoPlay that creates an object (nearestCue) and gives nearestCue the value of videoPlay.findNearestCuePoint(videoPlay.playheadTime), then read out nearestCue's name, label, etc. No dice.</p>
  
  <p>Nothing suggested in any posts I have reviewed (many, many posts) has provided an answer.</p>
  
  <p>This seems like it would be the easiest thing to accomplish but I have not been successful a single time.</p>
  
  <p>Any suggestions or assistance would be much appreciated.</p>
  
  <p>Thank you for your time!</p>