Livecode Wiki
Advertisement

Duplicates an object.

Built-in Message handler[]

Syntax:

clone [invisible] object

Examples:

clone field 1
clone the selectedObject
clone this card
clone invisible stack "myStack"

Use the clone command to create a copy of an existing object.

The clone command places the long id property of the newly created object in the it Keyword.

If the object is a control, its copy is placed on its card, 32 pixels below and to the right of the original object. The copy's name and other properties are the same as those of the original. If you want a clone on another card or stack, use copy.

If the object is a grouped control, the clone is also owned by the group.

If invisible is specified the new object will have its visible property set to false.

If the object is a card, the copy becomes the current card.

If the object is a stack, the newly created stack is opened. It is named "Copy of" and the stack's name. The clone command does not affect the contents of the clipboard.

See Also: create Command, copy Command, paste Command, newButton Message, newEPS Message, newPlayer Message, newField Message, newScrollbar Message, newGraphic Message, newImage Message, newCard Message, newGroup Message

Advertisement