# Button inside a movie clip

**URL:** <https://forum.kirupa.com/t/button-inside-a-movie-clip/289918>\
**Category:** Uncategorized\
**Created:** [June 7, 2009, 6:25am UTC](https://forum.kirupa.com/t/button-inside-a-movie-clip/289918 "2009-06-07T06:25:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![widget41](https://avatars.discourse-cdn.com/v4/letter/w/7ea924/32.png) [@widget41](https://forum.kirupa.com/u/widget41)\
**Post date:** [June 7, 2009, 6:25am UTC](https://forum.kirupa.com/t/button-inside-a-movie-clip/289918/1 "2009-06-07T06:25:18Z")

</div>

Hi i am a newbie but i thought this might be the best place for my question.

I have a flash that i am creating, it is complex and i am not very good.

i have scene 1 with preloader  
frame to entire site - which has pages layer, button layer menu layer, background layer, logo and header layer. all have one frame

in the pages frame movie clip opens to pages - layers are content, actions, background

now on the pages frames say frame 40 i have some buttons i am trying to get work. i have tried event listeners but get error - undefined property and have tried this too:

citeMc.contact.addEventListener(MouseEvent.CLICK, clickSection);  
function clickSection(evtobj:MouseEvent) {  
//tracing the event  
trace("The "+evtobj.target.name+ “button has been Clicked”);  
//go to the selection clicked on…  
gotoAndStop(evtobj.target.name);  
}

i get this error now:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at wax8b\_fla::allPages\_12/frame1()

maybe i am structuring it wrong and maybe i need to put actions in other places.

can anyone help me.
