Category Archives: DateFormatter

Scrubbing an FLV using the VideoDisplay control and a slider

In yet *another* post about the VideoDisplay control, this time we look at formatting playback times using the DateFormatter class/tag, creating a basic scrubber using an HSlider control, and applying a mildly annoying Zoom effect to the video.

Also, we tweak the slider control (or more accurately HSlider) and prevent users from clicking on the slider track (thanks to the allowTrackClick property, we set the liveDragging property to false to make sure we arent needlessly seeking around the video every time the slider thumb moves, and finally we invert the thumb arrow for no other reason than I didn’t know you could do that so easily.

Oh, and I also created a faux looping video by using the autoRewind property, and calling the play() method in the rewind event handler.

Full code after the jump.

Continue reading Scrubbing an FLV using the VideoDisplay control and a slider

Calculating the number of days between two selected dates in a DateChooser control

Here’s a marginally more interesting sample. I was playing around with the DateChooser (calendar) control and the selectableRange property and figured I’d make a simple application to calculate the differences between two selected dates. The example creates a selectable range of dates from the current date to current date plus 1 year. Users can select any single or range of dates between the start date and end date, and Flex calculates the number of days the user selected using some basic math.

Continue reading Calculating the number of days between two selected dates in a DateChooser control

Formatting dates using the DateFormatter

Another basic little example showing how to format the text in a DateField control using the DateFormatter and the DateField control’s labelFunction property. This entry also shows the pretty basic trick of creating a separate ActionScript class file that holds the day names as constants so you don’t constantly have to think whether Monday is day 0 or day 1 (hint: it is day 1).

Full code after the jump.

Continue reading Formatting dates using the DateFormatter