Constructors
Creates a Symbol item.
Sample code:
var circlePath = new Path.Circle(new Point(100, 100), 50); var circleSymbol = new Symbol(circlePath); circleSymbol.name = 'Circle'; // The original item is still contained in the document: circlePath.remove(); // The symbol can now also be accessed // through document.symbols: print(document.symbols['Circle']); // To place instances of the symbol in the document: var placedCircle = new PlacedSymbol(circleSymbol); placedCircle.position = new Point(150, 150);
- Parameters:
- item: Item — the source item which is copied as the definition of the symbol — optional
- Returns:
- Symbol
Properties
The symbol definition. The definition itself cannot be edited, just examined, replaced or cloned.
- Returns:
- Item
Specifies whether the item appears in the symbols palette. Listed symbols are saved when a document is closed, even if there are no instances of them within the document.
- Returns:
- Boolean — true if the item appears in the symbols palette, false otherwise
Functions
Checks whether the symbol is valid, i.e. it hasn't been removed.
- Returns:
- Boolean — true if the symbol is valid, false otherwise
Checks whether the symbol is selected in the symbols palette.
- Returns:
- Boolean — true if the symbol is selected, false otherwise
Activates the symbol in the symbols palette. The current active symbol can be retrieved from document.activeSymbol.
Set the index of the listed symbol in the symbols palette.
- Parameters:
- index: Number — -1 to move to end of list