# Accessing movieclips on different frames

**URL:** <https://forum.kirupa.com/t/accessing-movieclips-on-different-frames/301134>\
**Category:** flash\
**Created:** [December 3, 2009, 7:33pm UTC](https://forum.kirupa.com/t/accessing-movieclips-on-different-frames/301134 "2009-12-03T19:33:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonder](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bonder](https://forum.kirupa.com/u/bonder)\
**Post date:** [December 3, 2009, 7:33pm UTC](https://forum.kirupa.com/t/accessing-movieclips-on-different-frames/301134/1 "2009-12-03T19:33:51Z")

</div>

Okay, So i have a gallery on my root timeline

The gallery is called work\_mc. Inside of work\_mc I have various buttons. There is a different section on different frames. For example, ALL is on frame one, PRINT is on frame two, motion is on frame three.

In the root here is the code:  
Code:  
work\_mc.urbanthmb\_mc.addEventListener(MouseEvent.CLICK, clickHandler);  
work\_mc.urbanthmb\_mc.buttonMode = true;  
function clickHandler(event:MouseEvent):void {  
if (!workss\_mc) {  
workss\_mc = new mc\_workss();  
workss\_mc.addEventListener(“closeButtonClick”, onCloseClick);  
workss\_mc.x = 225;  
workss\_mc.y = 200;  
}  
work\_mc.gotoAndStop(“urbanflats”);  
addChild(workss\_mc);  
removeChild(work\_mc);  
}

function onCloseClick(e:Event):void {  
trace(“clickedtrue”);  
if (!work\_mc) {  
work\_mc = new mc\_work();  
work\_mc.x = 225;  
work\_mc.y = 200;  
}  
removeChild(workss\_mc);  
addChild(work\_mc);

}  
This is targeting the buttons that are on frame 1. How do I get to the buttons that are on frame 3? I tried just using the movieclip names but this doesnt seem to work?  
 ![](http://forum.kirupa.com/uploads/kirupa/615/b7e0d890f190c4d7.gif)[![](http://forum.kirupa.com/uploads/kirupa/3756/20ace7f93c5339be.gif)](http://www.actionscript.org/forums/newreply.php3?do=newreply&p=947842)
