I'm trying to get a movie to either show frames 1-3, 1-5, 1-7 or 1-10, by having the user choose one of four buttons on a starting menu screen that corresponds with the choices. But, no matter what I do (using GOTOs or, StopandPlays, etc...) I can't seem to get the program to recognize which button is pushed by the user, so it only displays words 1-3. Any navigation Gods out there?
Thanks for the hint oldnewbie...never thought of that (as it was my first post). BTW, I only have MX, not 2004 yet. Hope the zipped folder works.
Here it is
pepperman,
you're on the right track but a few small common errors are mucking it up.
first on the button press you have this:
on (release) {
counter = "1";
}
putting the 1 in quotes is telling flash that it is a string, similar to dog, cat, house. I'm assuming you want it to be a number so just remove the quotes.
---
second your conditional statement is like this:
if (counter = 1) {
gotoAndStop(22);
}
this is the grand daddy of flash annoyances and i fall for it all the time.
you need to have ==
like this:
if (counter == 1) {
gotoAndStop(22);
}
if you have one = in an if statement it SETS counter equal to 1. one = sign is what they call an ASSIGNMENT operator. it ASSIGNS a value to something. you use this when you are defining your variables.
if you have == it is called a COMPARISON operator which is used in conditional statements. you are comparing a variable to a desired value.
i've spent hours troubleshooting this in my own movies dozens of times. it will sink in
----
another problem is that you are using
gotoAndPlay to point to frames that have a stop() action on them. the stop action w/i the frame will terminate the gotoAndPlay action that sent you to it.
i am going to modify your fla with the corrections mentioned above so you can have it as a reference.i'll post it shortly.
i just reallized that you have a button setup to advance frames on keypress which wasn't particularly clear in your post or fla.
what you will have to do is...
reinsert the stop actions on the proper frames, and on the big button simply have a play function.
this way the movie will stop on everyframe and advance on press or keypress. when the playhead reaches one of the intermittant conditional statements it will read it and do as it is told.
also also, i noticed your button had 2 on(press) handlers, this will confuse flash.
meglomor,
You rock! The == totally solved my main stumbling point (lots of stuff to still work on though). Who woulda thought missing a single = would cause such a headache. Sorry about forgetting the arrows for frame advancement; brain cramp! Still trying to figure out some of the layers you added on what you returned to me. Thanx again. Likely be hearing from me again.