Problem getting different frames of video - code attached

Hi,

I need to get random frames of a video on request. I am using bitmapdata.draw(video) for this. But the problem I am facing is that I am not getting the snapshot of the exact frame. The video is there on localhost so I suppose the problem cannot be of Enhanced seek.

What happens is that when I do ns.seek(someTime), the videoContainer displays the required frame but the snapshot is taken according to ns.time ( which is not changing upon ns.seek(someTime)). So, the snapshot is something else and the videoContainer is displaying something else. Wierd!!

[LEFT][COLOR=#993300]function[/COLOR] manageDataCOLOR=#000000[/COLOR]:[COLOR=#993300]void[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#993300]var[/COLOR] frameno:[COLOR=#993300]int[/COLOR]=intCOLOR=#000000[/COLOR];
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"frame requested >> "[/COLOR] + frameno*vidDuration/vidTotalframes[COLOR=#000000])[/COLOR];

[COLOR=#993300]var[/COLOR] bmd:BitmapData=[COLOR=#993300]new[/COLOR] BitmapDataCOLOR=#000000[/COLOR];
[COLOR=#993300]var[/COLOR] scale1:[COLOR=#993300]Number[/COLOR]=vidWidth/videoContainer.[COLOR=#993300]width[/COLOR];
[COLOR=#993300]var[/COLOR] scale2:[COLOR=#993300]Number[/COLOR]=vidHeight/videoContainer.[COLOR=#993300]height[/COLOR];
[COLOR=#993300]var[/COLOR] myMatrix:Matrix = [COLOR=#993300]new[/COLOR] MatrixCOLOR=#000000[/COLOR];
myMatrix.[COLOR=#000000]scale[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"the time is >> "[/COLOR] + ns.[COLOR=#993300]time[/COLOR][COLOR=#000000])[/COLOR];
ns.[COLOR=#993300]pause[/COLOR]COLOR=#000000[/COLOR];
ns.[COLOR=#993300]seek[/COLOR]COLOR=#000000[/COLOR];
bmd.[COLOR=#000000]draw[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#993300]var[/COLOR] bitmap:Bitmap=[COLOR=#993300]new[/COLOR] BitmapCOLOR=#000000[/COLOR];
[COLOR=#993300]var[/COLOR] sampleMc:[COLOR=#993300]MovieClip[/COLOR]=[COLOR=#993300]new[/COLOR] [COLOR=#993300]MovieClip[/COLOR]COLOR=#000000[/COLOR];
sampleMc.[COLOR=#000000]addChild[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#993300]this[/COLOR].[COLOR=#000000]addChild[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]