Are there three back buttons or just one that spans frames 2 thru 4?
Good question. There is ONE button that spans frames 2 to 4.
I tried placing separate buttons on separate keyframes 2, 3, and 4 and gave each button a unique instance name... and entered separate scripts for these unique button instances on each separate frame, as well.
I thought this might do the trick, but instead I got "duplicate definition" errors. I thought the separation on different frames would avoid that.
1 person found this helpful
One button spanning the 3 frames should work, where you only have code in its keyframe (frame 2)... this is assuming the button is supposed to do the same thing in all three frames.
When you tried the three different buttons there could have been a couple problems at work. THe error sounds like you might have used the same function name for the event handler function. But placing the same symbol in adjacent frames can lead to issues as well unless you have them on different layers... the latter can inherit the instance name of the prior regardless that you assign it a name manually.
The button resides on frames 2-4, and the script now sits on a single keyframe spanning frames 2-4 (in case that hasn't been mentioned already).
I created two new buttons for my attempted "work-around" - "created", as in duplicating the original and placing them on my "buttons" layer at frames 3 and 4. So, I had three separate buttons that performed the same function - or so they were intended to.
Yes, I had duplicate functions because the script was the same on all three three keyframes - save for the button names.
What I keep thinking about is how I changed the functions from "gotoAndPlay" to "gotoAndStop" for frames 3 and 4. Frame 2's function is "gotoAndPlay". That is the only variable in the whole "equation" that changed - and it changed for the better in that it actually got the buttons on frame 1 to send me to frames 3 and 4 whereas they weren't working last night. Now if only the "back" button will work across the entire movie clip!
Thanks for following up!
1 person found this helpful
If I back up a bit on this, the problem may beclearer (to me)... If you have buttons in frame 1 to go to frame 3 or 4, but the code for back button is in frame 2, then you bypass that code and nothing gets assigned to those buttons. What you could/should do is have the single back button spanning frames 1 thru 4 and have a command in frame 1 to turn that button invisible. For the code that is assigned to the nav buttons in frame 1 you add code to turn the back button visible. So the button has its code assigned at frame 1, guaranteed, and it will not be visible in frame 1 due to the command to turn it invilsible being there. When you click a button in frame 1 it tells the back button to become visible before telling things to move down to frame 2, 3, or 4.
Hmmmmm! Interesting. So, I can have the back button span all four frames (with its script together with the other buttons' scripts), but have it invisible (and inactive?) on frame 1? How would I create that command?
But, to back up... yeah, I've got a single instance of the back button on a buttons layer that spans a single, un-broken frame which begins on frame 2 and ends on frame 4. The script layer's frame mirrors the button's frame. The "mc content" layer is where the movie clips reside and are supposed to go back to frame 1 when prompted by the back button.
Ned, that worked!!!!
I placed an instance of my back button onto the "buttons" layer on frame 1 (and then had to change the function to send frame 1 to frame 2 from "gotoAndPlay" to "gotoAndStop")....
... and "voíla!" - all three sub-clips in frames 2-4 go back to 1 with the "back button"!
Now, how do I make that instance of the back button on frame 1 "invisible"?
In frame 1 use...
guitarBack_btn.visible = false;
and in the event handler functions for the frame 1 menu buttons use...
guitarBack_btn.visible = true;
That way it will turn invisible anytime it enters frame 1, and when you click a menu button it will be made visible. An invisible button cannot be interacted with (but one with alpha = 0 can).
Thanks so much!