I have a 3 dimensional object rotating in a Flash video file (embedded in a MovieClip). Its 100 frames long.
It's trivial to drag an object in Flash to affect its x/y coordinates with startDrag()
...
But I want to be able to drag the object and change the currentFrame
of the MovieClip depending upon the position of the mouse from left to right.
My best idea is :
- Have an invisible box around the object
- Initiate startDrag() on the invisible box
- Set
currentFrame
during the drag operation based on the position from origin - Snap the invisible box back to the original position when the drag operation is complete - and record the frame offset for next time someone drags it
Just want to make sure there's no easier trick - or something 'out-of-the-box' (either AS3 code or IDE script) that I could use.
Edit I'm pursuing this approach and it's working quite well. However Flash doesn't seem to like seeking randomly backwards through a movie clip. If I drag to the right it plays smoothly, but if I drag to the left it is very jumpy trying to seek to a previous frame. Is there some AS3 to optimize 'reverse play'?