# Attach 2 of the same movieclips at once

**URL:** <https://forum.kirupa.com/t/attach-2-of-the-same-movieclips-at-once/323445>\
**Category:** flash\
**Created:** [July 1, 2011, 4:51am UTC](https://forum.kirupa.com/t/attach-2-of-the-same-movieclips-at-once/323445 "2011-07-01T04:51:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![negikun12](https://avatars.discourse-cdn.com/v4/letter/n/6a8cbe/32.png) [@negikun12](https://forum.kirupa.com/u/negikun12)\
**Post date:** [July 1, 2011, 4:51am UTC](https://forum.kirupa.com/t/attach-2-of-the-same-movieclips-at-once/323445/1 "2011-07-01T04:51:46Z")

</div>

s it possible to attach the same movieclip twice?  
for example i have two buttons and both attack Main\_Page however when i test the flash and error reads “Duplicate function definition”  
is there a way of attaching the same movieclip more than once?

im using this code to attach the movie but when i add this code twice on two buttons duplicate error shows:

s\_next.addEventListener(MouseEvent.CLICK, attachMovieclip);

function attachMovieclip(event:MouseEvent):void {  
var addPage1:Page1 = new Page1();  
addPage1.x= 0  
addPage1.y= 0  
addChild(addPage1);

}

the smile above not suppose to be there is actualy : and P  
thanks for any help
