# AS3 - clone a Sprite?

**URL:** <https://forum.kirupa.com/t/as3-clone-a-sprite/261424>\
**Category:** flash\
**Created:** [May 27, 2008, 2:43pm UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424 "2008-05-27T14:43:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![spasticfantastic](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@spasticfantastic](https://forum.kirupa.com/u/spasticfantastic)\
**Post date:** [May 27, 2008, 2:43pm UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/1 "2008-05-27T14:43:41Z")

</div>

Does anyone know if there’s a way to clone a sprite? It’s easy enough with a bitmap since BitmapData can be cloned. Any ideas?

---

<div class="post-metadata">

**Author:** ![GrndMasterFlash](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@GrndMasterFlash](https://forum.kirupa.com/u/GrndMasterFlash)\
**Post date:** [May 27, 2008, 3:37pm UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/2 "2008-05-27T15:37:46Z")

</div>

you could trace the sprit as a bitmap and clone it that way, or wrap the sprit in a movie clip and clone the movie clip but for a direct clone im not sure at the moment, does it have to stay a sprit object?

---

<div class="post-metadata">

**Author:** ![spasticfantastic](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@spasticfantastic](https://forum.kirupa.com/u/spasticfantastic)\
**Post date:** [May 28, 2008, 7:55am UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/3 "2008-05-28T07:55:10Z")

</div>

Yes it should stay a Sprite/ be identical.

Cloning a MovieClip is just as impossible as cloning a Sprite, so the wrapper idea wouldn’t be a solution.

While drawing the Sprite onto some BitmapData would clone it _visually_ there’s potentially a lot more to a Sprite than that, e.g. display children.

I don’t think this is possible - just found what I thought was the solution ([http://www.peterjoel.com/blog/?archive=2006\_02\_01\_archive.xml](http://www.peterjoel.com/blog/?archive=2006_02_01_archive.xml)) but it won’t work for DisplayObject.

---

<div class="post-metadata">

**Author:** ![dail](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@dail](https://forum.kirupa.com/u/dail)\
**Post date:** [May 29, 2008, 12:59am UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/4 "2008-05-29T00:59:25Z")

</div>

What about this;

> **[ActionScript 3 Tip of the Day - Page 12](https://www.kirupa.com/forum/showthread.php?p=1939827#post1939827)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [May 29, 2008, 1:03am UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/5 "2008-05-29T01:03:42Z")

</div>

[QUOTE=dail;2332729]What about this;

> **[ActionScript 3 Tip of the Day - Page 12](https://www.kirupa.com/forum/showthread.php?p=1939827)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

FYI, that Flash 9 bug has been fixed in … well, some version of Flash 9 so a version check really should be added to only apply that in versions it’s been broken.

---

<div class="post-metadata">

**Author:** ![spasticfantastic](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@spasticfantastic](https://forum.kirupa.com/u/spasticfantastic)\
**Post date:** [May 29, 2008, 7:35am UTC](https://forum.kirupa.com/t/as3-clone-a-sprite/261424/6 "2008-05-29T07:35:16Z")

</div>

Thanks for the link!
