Why do group ID's change when cloning a stack
Richard Gaskin
ambassador at fourthworld.com
Mon Aug 14 13:21:13 EDT 2006
Robert Sneidar wrote:
> No, it's sketchy because certain operations like cloning or copying
> cards can change ID's, because ID's must be unique in a Revolution
> stack. Also one programming method uses hidden objects as templates
> and then "clones" them so that there is consistency in the interface.
> It's easier than p[rogrammatically setting all the properties every
> time a new object is created. In this case ID's are useless.
Not to mention that they have no mnemonic value; it's just easier to use
the name property.
IDs are useful for dynamically obtaining absolute references to an
object, such as setting properties of a newly created button:
create button
set the backColor of it to 240,240,240
There are many such examples, but for cases where object references must
be hard-wired in a script it's usually simpler to just use the object's
name.
Going back to the original question, I wonder if the IDs of cloned
groups change because it's possible to reference groups in other stacks
as the menuBar group. I don't know, just guessing here. Scott Raney
would know, but maybe Mark Waddingham may know the origins of this as
well and could chime in with his opinion.
--
Richard Gaskin
Managing Editor, revJournal
_______________________________________________________
Rev tips, tutorials and more: http://www.revJournal.com
More information about the use-livecode
mailing list