(snip)
> Evidently, 'the target' is getting disassociated from the proper
> enclosing group -- but why am I having no trouble setting all four digits
> on a clock? Just like the clocks, each digit is identical, differring
> only in name.
This is a bug: "group x of the target" and "group x of me" incorrectly
start from the card when looking for "group x". Expressions of the
form "button x of the target" do work correctly, though, when the
target is a group. This bug is fixed in 2.1.2B2.
But though your design does have a certain elegance, it's pretty
difficult to understand and I think more complicated than is
necessary. I can think of a couple of different architectures to
simplify your design:
1) Instead of having each segment of each digit be a separate graphic
object, use a single graphic for each of them. You can do this
because blank lines in the "points" property cause a "pen up", meaning
you can have multiple independent segments in the same graphic. For
example, to draw an X, you might set the points property to:
0,0 & cr & 10,10 & cr & cr & 0,10 & cr & 10,0
The double return (cr) characters is a blank line, meaning point 2
should not be connected to point 3 with a line segment. You'd store
the list of points needed to draw each type of digit in a custom
property or hidden field. Note that if you do this, you need to
offset each of the points to get each line to draw in the correct
location (add an x,y offset to each of them before setting the
"points" property).
Even simpler, set points property of the graphic to a single point at
the topleft of the graphic, and set the markerPoints to the sequence
of points necessary to draw a digit. Then you don't even have to do
any offsetting before doing each set (markerPoints are automatically
offset to each of the points in the graphic). The markerPoints also
support this "pen up" feature, can be filled (solid), and have their
own line and fill colors. See the "markers" dialog from "graphic
properties" palette for some examples.
2) Use buttons for the digits and set the "icon" property of the
button to a GIF graphic for the digit you want to display. There are
many collections of digits available for free. One comprehensive
source for these sets is http://www.digitmania.holowww.com/ With this
route, you've got a lot more choices than just what you can easily
produce with the graphic object.
**********************************************************
Scott Raney raney@metacard.com http://www.metacard.com
Only 1% of computer users know a programming language...
MetaCard: We can change all that.