clone

Duplicates an object.

# Metadata

Platforms: desktop, server OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

clone [invisible] object [as newName]

# Params

- object : An object or stack reference or an expression that resolves to either. - newName : An optional name for the new object.

# Examples

clone field 1

clone the selectedObject

clone this card as "clonedCard"

clone invisible stack "myStack"

# Description

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

If the object is a control, its copy is placed on the current 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 the object is a grouped control, the clone is also owner by the group.

>*Note:* 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.

If the 'as' variant is used, the newly created object is given the specified name.

# Tags

# See

- **property:** pixels, properties, name - **message:** newAudioclip, newButton, newCard, newGroup, newPlayer, newGraphic, newField, newScrollbar, newEPS, newImage, newVideoclip - **keyword:** card, control, it - **glossary:** object, grouped control, current card, owner, command - **function:** clipboard - **command:** create card, paste, group, copy, create stack - **object:** stack