Reusing a group on the same card
Posted: Mon Oct 20, 2014 8:10 pm
Hi LiveCoders!
I am creating an app to demonstrate how Grade 2 Braille is written. Each character pattern is composed of 6 dots. I have created a group called Braille Dot containing 6 oval graphics. I have added a script to the group so that a call to setPattern(pInteger) will set the background colour of the appropriate dots to black to create one of the 64 possible patterns. So far so good.
I now want to show a group of symbols, to create a word. For example, the word "teaching" would be written in 4 patterns as "t-ea-ch-ing", and "learner" would be 5 patterns as "l-e-ar-n-er".
I had hoped that I would be able to add my Braille Dot group to the card multiple times, and to call setPattern() on each group independently, so that each instance of the group would show a different pattern. As far as I can tell, I will have to create many distinct groups, each containing 6 distinct oval graphics. This seems like unnecessary duplication.
I understand that I can set the `behavior`of each group to point at one unique control, so I do not need to duplicate the script.
Is there a similar technique that would allow me to display many instances of the same control on the same card, each with a different set of properties (similar to setting `sharedText` property for a field to false)?
Thanks in advance,
James
I am creating an app to demonstrate how Grade 2 Braille is written. Each character pattern is composed of 6 dots. I have created a group called Braille Dot containing 6 oval graphics. I have added a script to the group so that a call to setPattern(pInteger) will set the background colour of the appropriate dots to black to create one of the 64 possible patterns. So far so good.
I now want to show a group of symbols, to create a word. For example, the word "teaching" would be written in 4 patterns as "t-ea-ch-ing", and "learner" would be 5 patterns as "l-e-ar-n-er".
I had hoped that I would be able to add my Braille Dot group to the card multiple times, and to call setPattern() on each group independently, so that each instance of the group would show a different pattern. As far as I can tell, I will have to create many distinct groups, each containing 6 distinct oval graphics. This seems like unnecessary duplication.
I understand that I can set the `behavior`of each group to point at one unique control, so I do not need to duplicate the script.
Is there a similar technique that would allow me to display many instances of the same control on the same card, each with a different set of properties (similar to setting `sharedText` property for a field to false)?
Thanks in advance,
James