How to select image object instead of group

Scott Rossi scott at tactilemedia.com
Sat Dec 11 03:55:01 EST 2010


Recently, Scott Pepperdine wrote:

> The image script is:
> on mouseup
>     answer file "Select your file:"
>     if it is  empty exit to top
>     set the filename of image "image" to it
> end mouseup
> 
> The group script is as follows ( just to prove to me this what was
> happening:
> on mouseup
>     answer "1033"
> end mouseup
> 
> Thanks all for your efforts.  I think I;ll just ungroup the controls and
> create my new cards with 'clone' or some such think, instead of relying
> on the background group behavior.

I really hope you don't have to dumb down your stack to get the above
working.  Let's verify a couple of things:

1) You realize that by putting your image in a group, it's available on all
cards that contain that group, yes?  So if you change the image on one card,
it will change on all cards that contain that group.  If you want the image
to be different across multiple cards, you'll either need to use multiple
images (one for each card, not in a common group) or store the image data
for each card separately (in custom properties, for example) and load the
image data upon opening each card as needed.

2) The most common reason to put an object in a group is to use the same
object/script across multiple cards.  Fields within groups have the ability
to hold shared data (sharedText enabled) across multiple cards, or to have
separate data for each card (sharedText disabled).  Images do not have this
ability natively, but you can script it, as explained above.

So what exactly are you trying to accomplish?  Multiple images across
multiple cards, or one image across multiple cards?

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design






More information about the use-livecode mailing list