# \[fmx\] button not behaving itself

**URL:** https://forum.kirupa.com/t/fmx-button-not-behaving-itself/87073
**Category:** flash
**Created:** [April 18, 2005, 10:07am UTC](https://forum.kirupa.com/t/fmx-button-not-behaving-itself/87073 "2005-04-18T10:07:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jakepeg](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@jakepeg](https://forum.kirupa.com/u/jakepeg)
#### Post date: [April 18, 2005, 10:07am UTC](https://forum.kirupa.com/t/fmx-button-not-behaving-itself/87073/1 "2005-04-18T10:07:31Z")

</div>

I have made a button - named “menu\_btn” this button has up, over, down and hit states. It has no Linkages.

I have a movie clip - named “menu\_item” this movie clip contains the “menu\_btn” button and has a dynamic text textfeild named “item\_caption” on top of the button. It has Linkages, Export for ActionScript, Export in first frame.

I have writen the following function…

//create menu based on xml file  
function makeMenu(sectionMenu) {  
//set the initial on screen text to the text of the first section  
text\_txt.text = sectionMenu.pmntasection[0].pmntasectionText;  
//create movie clip to hold menu items  
\_root.createEmptyMovieClip(“tc”, 1);  
//set the position on screen of the movie clip that holds the menu items  
tc.\_x = 90  
tc.\_y = 110  
//loop through adding menu items  
for(var i = 0; i \< sectionMenu.pmntasection.length; i++) {  
//attach item\_btn movie clips  
var c = tc.attachMovie(“item\_btn”, “chap” + i, i);  
//set the position of the item\_btn movie clips  
c.\_y = 35 \* i;  
//put the text on the menu items  
c.item\_caption.text = sectionMenu.pmntasection\*.pmntasectionName;  
c.chapNumber = i;  
//add the action to the button  
c.onRelease = function() {  
text\_txt.text = sectionMenu.pmntasection[this.chapNumber].pmntasectionText;  
}   
}  
}

It all works fine except the button states do not change. The squirrel finder example on this site ([http://www.kirupa.com/web/xml/examples/squirrelfinder.htm](http://www.kirupa.com/web/xml/examples/squirrelfinder.htm)) does what I want to do, and I have made my movie the same - well I must be missing something - but what? where am I going wrong? Please help as I’ve been trying to crack this all weekend. Thanks.
