mcUIControls - VCR Controls

The standard way to control an animation is to provide VCR controls The mcUI_VCR_Controls component provides that capability .. plus a way to control the speed of the animation and a way to display a frame identifier.

This control was originally developed for displaying a series of atmosphere soundings (weather balloon data) as an animation. As a result, it was necessary to control the time between frames. In addition, since displaying the frame numbers provided no useful information, a field was provided so that the date and time of the sounding (one sounding per frame) could be displayed.

In practice, this control is coupled with a slider so the user can

The slider is not included with this control because it is strongly coupled to the data and, therefore, is not generic enough to include here. The generic part of the slider is provided by mcUISlider.js.

Only a single instance of this control can be used in an application - this is a javascript limitation because there is no way to know which of several timers calls a specific function. It is possible that anonymous functions might make this more generic, but that was not tested. To make this work, the component names would also have to be unique per instance.

Example | Test procedure | Header tags | UI Components | Properties | Methods


Example

The component above is placed in a table to control the maximum width. The border is produced by an HTML fieldset component that is a part of the control. Test code for this page.


Test procedure

The most obvious test is whether the control is displayed or not.

Assuming that it is, the 3 buttons will cause the current frame number to change.


Header tags

These tags load the required library files. The code will automatically configure a component with an id of mcUI_VCR_Control.


UI Components

These component id's are hardcoded - they don't need to be, there are other ways. This is one of the reasons that only a single instance can appear on a given page. However, the main problem is that the only way to determine which timer fired is to assign each to a unique function.


Properties

Use these to control which frames are displayed.


Methods


Author: Robert Clemenzi
URL: http:// mc-computing.com / Languages / Javascript / mcUIControls / mcUIVCR_Controls.html