# Code in Main Timeline - buttons not working

**URL:** https://forum.kirupa.com/t/code-in-main-timeline-buttons-not-working/248057
**Category:** flash
**Created:** [January 3, 2008, 11:11am UTC](https://forum.kirupa.com/t/code-in-main-timeline-buttons-not-working/248057 "2008-01-03T11:11:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![CreativityAwait](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@CreativityAwait](https://forum.kirupa.com/u/CreativityAwait)
#### Post date: [January 3, 2008, 11:11am UTC](https://forum.kirupa.com/t/code-in-main-timeline-buttons-not-working/248057/1 "2008-01-03T11:11:56Z")

</div>

Ok - think the beer killed a few brain cells - need help…

I got a flash file which am coding in AS2.0 and all code on the main timeline.

Within a movieclip there is a button on the timeline which I can access from the main timeline, i.e.

KPI\_mc.new\_btn.onRelease = function(){  
KPI\_mc.gotoAndStop(“New”);  
}

This then goes onto another part of the timeline with another button called ‘save’. But the following code doesn’t work. Is there anything I need to do for it to be accessable from the main timeline?

KPI\_mc.save\_btn.onRelease = function(){  
trace(“hi”);  
KPI\_1 = KPITitle;  
KPI\_1Desc = KPIDesc;

```
//move on to the menu screen
KPI_mc.gotoAndStop("Menu");

```

}

If I put the save button by the ‘new’ button it works… Any help?
