# Attach movie clip stuff

**URL:** https://forum.kirupa.com/t/attach-movie-clip-stuff/36258
**Category:** Uncategorized
**Created:** [November 24, 2003, 7:39pm UTC](https://forum.kirupa.com/t/attach-movie-clip-stuff/36258 "2003-11-24T19:39:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gmh526](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@gmh526](https://forum.kirupa.com/u/gmh526)
#### Post date: [November 24, 2003, 7:39pm UTC](https://forum.kirupa.com/t/attach-movie-clip-stuff/36258/1 "2003-11-24T19:39:34Z")

</div>

first id like to say that i have very little idea what im talking about.

hmmmmmm… ive been having problems with my actionscripting.  
i want a movieclip to be attached to another one when a key is pressed. i thought something like this would work:

onClipEvent (enterFrame) {  
if (key.isdown(key.SPACE)) {  
clip1.attachMovie(“clip2”, “clip2newname”, 10);  
}  
}

where “clip2” is the linkage identifier for the mc to be attached. the code is placed on the outside of the clip one, where i want clip2 to go.

the attachmovie method works on its own, but not with the if condition.

any help is appreciated
