document.setTaggedSwatchAtIndex()
#### Availability
Animate 2020.
#### Usage
document.setTaggedSwatchAtIndex(oldSwatchIndex:int ,newSwatch:Object [,palette:int ]).
#### Parameters
oldSwatchIndex:It is an integer that specifies the index of the tagged swatch to update.
newSwatch:swatch object to replace with.
palette:It is an integer that specifies the index of the tagged swatch palette,default value is 0.It is optional.
#### Returns
Nothing.
#### Description
Method;replace the tagged swatch with the given index to the given new swatch object.
#### Example
The following example replace the tagged swatch with the given index 0 to the given new swatch object swatch1.
javascript
var document = fl.getDocumentDOM();
var swatch1 = new Object();
var fill = fl.getDocumentDOM().getCustomFill();
fill.color = "#FF00FF";
fill.style = "solid";
swatch1.fill = fill;
swatch1.name = "solid_swatch";
document.setTaggedSwatchAtIndex(0,swatch1);
#### See also
document.setTaggedSwatchByName() (../Document_object/docu6068.md)