Code on buttons within MC does not work
(Flash CS5, Actionscript 2.0)
Hello all,
I've been having a very frustrating problem. I have two buttons, one to go to the next scene and one to go to the first scene of my game. The problem I've found is that any code, ANYTHING I put within an on (release) or a buttonname.onRelease = function() in the main timeline does not work at all.
The button states (up, over, down) work and display correctly. When I click, it shows the down state, as it should. However, any code that is on them does not run. currently I have this on the main timeline:
mcname.onEnterFrame = function() {
button1name.onRelease = function() {
trace("this should work");
}
button2name.onRelease = function() {
trace("this should work");
)
)
Neither trace ever shows up. I really want the code to be (on the buttons):
on (release) {
nextScene();
}
but that just doesn't want to work, no matter if I put _root. or _level0. or whatever before the nextScene tag.
I have tried it many, many other ways as well. I have tried putting this function on the mc, I have put the code directly on the buttons, and NOTHING WORKS. It's very, very frustrating.