User Guide

528 FLVPlayback Component (Flash Professional Only)
You might notice that the handle movie clip has a rectangle in the background with alpha set
to 0. This rectangle increases the size of the handles hit area, making it easier to grab without
changing its appearance, similar to the hit state of a button. Because the handle is created
dynamically at runtime, it must be a movie clip and not a button. This rectangle with alpha
set to 0 is not necessary for any other reason and, generally, you can replace the inside of the
handle with any image you want. It works best, however, to keep the registration point
centered horizontally in the middle of the handle movie clip.
The following ActionScript code is on Frame 1 of the SeekBar component to manage
the handle:
stop();
handleLinkageID = "SeekBarHandle";
handleLeftMargin = 2;
handleRightMargin = 2;
handleY = 11;
The call to the stop() function is necessary due to the content of Frame 2.
The second line specifies which symbol to use as the handle, and you should not need to
change this if you simply edit the handle movie clip instance on Frame 2. At runtime, the
FLVPlayback component creates an instance of the specified movie clip on the Stage as a
sibling of the Bar component instance, which means that they have the same parent movie
clip. So, if your bar is at the root level, your handle must also be at the root level.
The variable
handleLeftMargin determines the handles original location (0%), and the
variable
handleRightMargin determines where it is at the end (100%). The numbers give the
offsets from the left and right ends of the bar control, with positive numbers marking the
limits within the bar, and negative numbers marking the limits outside the bar. These offsets
specify where the handle can go, based on its registration point. If you put your registration
point in the middle of the handle, the handles far left and right sides will go past the margins.
A seek bar movie clip must have its registration point as the upper-left corner of its content to
work properly.
The variable
handleY determines the y position of the handle, relative to the bar instance.
This is based on the registration points of each movie clip. The registration point in the
sample handle is at the tip of the triangle to place it relative to the visible part, disregarding
the invisible hit state rectangle. Also, the bar movie clip must keep its registration point as the
upper-left corner of its content to work properly.
So, for example, with these limits, if there a bar control is set at (100, 100), and it is 100 pixels
wide, the handle can range from 102 to 198 horizontally and stay at 111 vertically. If you
change the
handleLeftMargin and handleRightMargin to -2 and handleY to -11, the
handle can range from 98 to 202 horizontally and stay at 89 vertically.