[font=Times New Roman]Ok, on a scene I have a movieclip, let’s call it “movie_mc” that has some button on it, “button_mc”. So the button is on the movieclip, not on the frame by itself.[/font]
[font=Times New Roman]In the frame’s code I want to write a function for when the button is released, but can’t seem to get the proper path to the button_mc. I’ve tried:[/font]
[font=Times New Roman]
[/font]
[font=Fixedsys]_root.movie_mc.button_mc.onRelease = function(){ /* code here */}[/font]
[font=Fixedsys]movie_mc.button_mc.onRelease = function(){ /* code here */}[/font]
[font=Fixedsys]button_mc.onRelease = function(){ /* code here */}[/font]
[font=Fixedsys]_root.button_mc.onRelease = function(){ /* code here */}[/font]
[font=Times New Roman]
[/font]
[font=Times New Roman]None of these however trigger the code when I press the button. If the movieclip is converted into a Graphic, then the 3rd line of code works. However, this isn’t an option because I really need it to be a movieclip. Any help?[/font]
No dice. I’ve triple- and quadruple-checked the spelling. I even verified the variable name using the debugger variable listing.
Does it matter that the buttons only appear on the last frame of the movieclip? How it works is the movieclip plays an animation, and on the last frame, the buttons appear, and the movieclip is stopped on that frame. So I can see the buttons… even the Up/Over/Down visualizations work for them… just no response when I click on them.
yes, guys, putting code on the button works. However, unfortunately, it isn’t a plausible solution to my problem. For one, it fragments the code which I want to avoid.
More importantly, I need to reference the button in other parts of code (such as when I want to enable/disable the button, etc), not just perform the onRelease procedures.
Doesn’t make sense to me that when the buttons are obviously on the screen, I can click on them but nothing happens even though the variable name is correct.