Behaviors & Image References

David Bovill david.bovill at gmail.com
Wed Apr 29 04:47:11 EDT 2009


Maybe I don't get the question - my guess is you have something like a
button in a group that uses an image in its behavior stack for its icon (say
the image in the behavior stack is called "flag" for example), and you want
to refer to this image by name - and not have to know / use its ID?

The only thing I can think of is to define some getprop / setprops in a
library that check if there is a behavior and search for images in that
stack:

set the behavior_ImageName of btn 1 to "flag"
> put the behavior_ImageName of btn 1 into imageName
> put the behavior_ImageNames of btn 1 into possibleNames
>

is that the sort of thing?

2009/4/29 J. Landman Gay <jacque at hyperactivesw.com>

> Scott Rossi wrote:
>
>> I understand that with the new behaviors, image ids are automatically
>> resolved beginning with the stack containing the behavior button, but how
>> do
>> we reference an image in the same behavior stack by name?  If one doesn't
>> know the id of an image located in the behavior stack, how is the image
>> referenced without using a full path reference (which defeats the purpose
>> of
>> behaviors)?
>>
>
> Behaviors mainly deal with scripts and message paths. The engine includes
> the behavior button's stack as part of the regular search path when looking
> for IDs, but as I understand it, other objects themselves aren't part of
> behaviors. So you'd need to provide the same sort of path for other object
> references as we always have.
>
> While I guess it isn't entirely accurate, I still think of behaviors as
> sort of a private backscript.



More information about the use-livecode mailing list