# Duplicating mc's with keys

**URL:** <https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357>\
**Category:** Uncategorized\
**Created:** [September 5, 2004, 11:19pm UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357 "2004-09-05T23:19:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevemyster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@stevemyster](https://forum.kirupa.com/u/stevemyster)\
**Post date:** [September 5, 2004, 11:19pm UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357/1 "2004-09-05T23:19:02Z")

</div>

hi, im looking for some help on duplicating mc’s with keys instead of the mouse. ive been working with flash for quite some time, and i think im pretty good. i have about 13 submissions on newgroundw with descent scores, and 2 of them are even in an archive. im kinda new with actionscript though, ive been learning for about a month now. but im kinda on and off. so can anyone help me on duplicating mc’s with keys?

this is wat i have.

onClipEvent (keyDown) {  
if (Key.isDown(SPACE)) {  
i = i + 1;  
duplicateMovieClip (\_root.box, “box” + i, i);  
}

thnx ahead of time.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 5, 2004, 11:22pm UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357/2 "2004-09-05T23:22:35Z")

</div>

I have a small side scrolling game that I made that uses key presses to duplicate the bullets the guy shoots. If you would like a copy to look through, let me know. I know a few people have used it on this forum and have found it helpful.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 5, 2004, 11:33pm UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357/3 "2004-09-05T23:33:37Z")

</div>

> [@Behemoth-Dan](#):
>
> I have a small side scrolling game that I made that uses key presses to duplicate the bullets the guy shoots. If you would like a copy to look through, let me know. I know a few people have used it on this forum and have found it helpful.

sure, ill be entirely greatful if u cud do that. thnx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2004, 2:38am UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357/4 "2004-09-06T02:38:16Z")

</div>

I’ve never used onClipEvent(keyDown) but i’m sure this will work.  
Use this:

onClipEvent(enterFrame){

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2004, 2:40am UTC](https://forum.kirupa.com/t/duplicating-mcs-with-keys/63357/5 "2004-09-06T02:40:38Z")

</div>

Have you tried moving the new boxe’s .\_x and .\_y to get them to a new location…

Also check to make sure your function is working by including a trace in it… 🙂
