Discussion: Frame sequencing HTML code
4 messages from 4 displayed.
Hi Andrew, the question is why you need such feature? Currently, there's no standard implementation and it's quite a problem. The reason is that video frames are synchronized with the display refresh rate and may vary. What can be done is:
I can't think of a need for seeking video frames instead of just skipping some small amount of time.
Thank you for the reply David. I believe I am on the right track with some code I just found online:
myButton.onRelease = function() {
nextFrame();
// a play method can be added, or any other actions performed
};
This code could perhaps work for the random frame sequence I need, but I also need to edit the PLAY function to reflect my custom sampling rate. Is there a way to do that in any existing code? So instead of playing every next frame, it should playback the frames by my values.
I wish I knew more about coding, so I'm going to make an effort to learn what I need to know for this task. If I knew anyone with Java skills and $30k I would offer them partnership on this project. I assure you, the need exists, even if you can't see it. It exists to the tune of $400m per annum.
My goal for now is to build a player with only 2 buttons to allow calibration of the cameras. Once calibration is complete I will know the exact values to add to the code. When the software build is ready, we start calibration and record a demo video to showcase the capabilities of the tech.
Please look at the file I attached and let me know if you think it can do the trick.
Thanks much
nextFrame
nextFrame()
This method is compatible with Flash 2 and later.
The nextFrame() method moves the playhead to the next frame and stops there. See also prevFrame(), MovieClip.nextFrame(), and MovieClip.prevFrame().
Description
The nextFrame() method moves the playhead to the next frame in the timeline, and stops playback at that point. See also MovieClip.nextFrame() for an explanation and examples.
Code
Additional explanation
Notes
nextFrame();
Moves the playhead to the next frame.
Playback is stopped when the nextFrame() method is called.
nextFrame(3);
No frame number can be specified; see gotoAndStop().
A frame number could be specified with this method in Flash 2 through Flash 4, but is not supported with Flash 5 and later.
Examples and practical uses
The nextFrame() method is used to move the timeline’s playhead to the next frame and stop there. It is often tied to an action such as a user clicking on a button. For example, if you have an intro Flash movie and want the user to click on a button to move on to the next part, you can stop the movie at one frame that has a button attached to it, and wait for the user to click the button. When they do, you move to the next frame:
on (release) {
nextFrame();
// a play method can be added, or any other actions performed
}
Using a button in a movie lets the user single-step through a movie’s frames, especially if there is tweened animation and you want to let the user pause at specific intervals in the movie. The code above is in Flash 5’s coding style. Flash MX and later releases allow the use of a function associated with a button. In this case, the button called myButton is used to call the function that moves to the next frame:
myButton.onRelease = function() {
nextFrame();
// a play method can be added, or any other actions performed
};
Tips and precautions
If you want to move to a specific frame, rather than then next frame, you can use the gotoAndPlay() or gotoAndStop() methods, referencing the current frame (using the _currentframe property) like this:
myButton.onRelease = function() {
gotoAndPlay( _currentframe + 2);
};
In this case the code lets you move forward two frames instead of one using the nextFrame() method. The nextFrame() method is the same as writing:
gotoAndStop( _currentframe + 1);
The nextFrame() method does not return anything. See also prevFrame(), MovieClip.nextFrame(), and MovieClip.prevFrame().
If the nextFrame() method is invoked on the last frame of a timeline and there is no scene following, the playhead stops at that location. If there is a scene following the last frame of the current scene, the playhead moves to Frame 1 of the next scene.
4 messages from 4 displayed.