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) 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.