# Video problem - delay on seek

**URL:** <https://forum.kirupa.com/t/video-problem-delay-on-seek/322378>\
**Category:** flash\
**Created:** [May 19, 2011, 3:43pm UTC](https://forum.kirupa.com/t/video-problem-delay-on-seek/322378 "2011-05-19T15:43:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boswaldo](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Boswaldo](https://forum.kirupa.com/u/Boswaldo)\
**Post date:** [May 19, 2011, 3:43pm UTC](https://forum.kirupa.com/t/video-problem-delay-on-seek/322378/1 "2011-05-19T15:43:42Z")

</div>

Hi - just a quick question regarding the ‘seek’ function in AS3.  
I have a flash app containing a video file with several buttons to jump the playhead to individual chapters within the video.I have created a function that constantly checks the video’s playheadTime (on enterframe), and then highlights the correct chapter button accordingly. I am then using a ‘seek’ command to jump the playhead to the correct point (in seconds) within the video timeline when a user clicks on one of the chapter buttons.

This all works fine locally but when working with streaming video i hit a couple of issues. Firstly, the playhead delays for at least a second before seeking to the correct point when the user highlights a chapter button. Secondly, and slightly more seriously, if the user clicks rapidly through the chapter buttons the seek queries seem to queue (meaning that a new seek does not cancel out any previous/ongoing seek requests), as such the delay accumulates with each successive click until it becomes pretty much unusable.

I am pretty new to flash and to scripting in general, i wondered whether anyone could suggest a solution to this? Is there, for example, a way to cancel all current seek commands before a new one is executed?

Thanks in advance, Michael
