SWiSH Player Support
SWF4 or later - Supported Internally
Syntax
spritename.removeSprite()
Arguments
spritename: The target path of the Sprite / Movie Clip to delete.
Returns
Nothing.
Description
Sprite Method: Removes an Instance of a Sprite created with the duplicateSprite() method.
Sample
This example duplicates the existing Sprite, s1, and creates a new Sprite s2 on the same level. The position of both Sprites is adjusted so that they can be seen. To remove the duplicated Sprite, use s2.removeSprite(). The created Sprite, s2 is removed after Frame 12.
onLoad () {
s1.duplicateSprite("s2",1);
s1._X += 50;
s1._Y += 50;
s2._X += 150;
s2._Y += 50;
}
onFrame (12) {
s2.removeSprite(); // remove the duplicated Sprite
}
See also
duplicateSprite