Overview
Flash simplifies creating the three mouse states by defining each part as a button ... but then the mouse cursor changes to a hand, which is totally nonstandard. This can be disabled in code.
3D components
I don't understand why each version of an operating system uses a different set of colors - in Windows 98, ScrollBar controls were light tan (grayish), with Windows XP, they are blue ... and the icons are even different.
Drawing the Arrows
As you draw the triangle, you will be able to rotate it. Though it can be oriented in any direction, it tends to stick when oriented up, down, left, or right.
Don't worry about the size or position ... after drawing the Arrows, use the Properties frame to explicitly set Height, Width, X, and Y according to the table below.
Arrow Buttons
Using the data on 3D Controls, I created an UpButton graphic and a DownButton graphic. What a pain, I had to repeatedly edit and re-edit because the XY coordinates kept changing. For instance, if you set one of them to 1.0, when you check it later, it is now 0.9 ... or perhaps 1.1 - this changes on a regular basis. You can tell something is wrong because there are gaps everywhere.
Then create 4 separate buttons that use those graphics.
Arrow Placement
Left | Right | Up | Down | ||||||
---|---|---|---|---|---|---|---|---|---|
Up | Down | Up | Down | Up | Down | Up | Down | ||
W | 7 | Same | |||||||
H | 9 | Same | |||||||
X | 5 | 6 | 5 | 6 | 5 | 6 | 5 | 6 | 1 to the right |
Y | 4 | 5 | 4 | 5 | 4 | 5 | 4 | 5 | 1 down |
Failures
This is just another way to say that Flash is not very logical and that the built-in help was not particularly useful. This section documents some of my failures ... and a Flash desigh problem or two.
Creating the Arrows
That's right, in design mode, arrows were displayed (as expected), but when the form was run, ....
Unfortunately, there is no way to include the Marlett font in the final document.
In my opinion, if a font won't work, then it should not be available.
Creating Buttons
Then I tried to use this base clase to create 4 buttons, each with an arrow pointing in a different direction. Unfortunately, this does not work ... the buttons no longer press. Apparently, you should never make a button from a button.
Granted, this approach and the one described above both create 4 button objects, but ... If this were a true object oriented language, this type of experimentation would not have been necessary.
9-slice scaling
Well ... that is not even close to true. When I stretched my scroll bar, the arrows at the ends were highly distorted. Maybe 9-slice scaling just doesn't work with MovieClips made of MovieClips ... but that is not in the help.
Solution, I had to reset the "fixed" component sizes in the code.
Dimensions
Component | Design time | Run time | ||
---|---|---|---|---|
Width | Height | Width | Height | |
Slider | 17.0 | 17.0 | 18.3 | 18.3 |
Left Arrow | 17.0 | 17.0 | 18.3 | 18.3 |
Right Arrow | 17.0 | 17.0 | 18.3 | 18.3 |
Channel | 300.0 | 19.0 | 304.8 | 20.3 |
Scrollbar | 474.0 | 19.0 | 481.6 | 20.3 |
At runtime, the Channel width should have been 474.0 - the length of the object on the form ... Not the value from the MovieClip.
On the form, the Scrollbar shows a width of 474.0 ... Yet it also shows a different value in code.
In addition to this (and probably related), I had to repeatedly edit the height, width, x- and y-positions on all MovieClips used to create the scrollbars - Flash kept magically changing them. And, when the scrollbars are rendered, the sharp 1-pixel wide lines are blured across several lines.
This program - yes, I mean Flash by Adobe - has so many design problems I'm suprised anyone can make it work.
FThumb.mouseX
Oh, it worked ok as long as I didn't try to change the size of the scrollbar
Author: Robert Clemenzi - clemenzi@cpcug.org