So i am working on a slide show for my class and im stuck. I have 2 buttons(next and previous). The next button adds +1 to my "picture" variable and the previous button subtracts -1 to the variable. I have the code(not in this syntax of coarse) if picture == 1 gotoandstop pic1, if picture==2 gotoandstop pic2 and so forth, but for some reason it isnt working. I am using CS4 on a mac.
If someone could help me out that would be awesome. It's for my midterm due tomorrow :(
All your buttons are doing is incrementing or decrementing a variable called picture.
You then have a frame (73) which is setting picture to 1.
You then have some conditional statements that send the playhead to whatever frame is indicated by the value of picture. But that code, which is on the frame called pic1, is only run once. So since picture is equal to 1, the playhead will always go to pic1. If the user then increments picture to 2, nothing will happen, because that conditional statements (the ifs) have already run.
My analysis may be wrong, because the code is confusing. It's confusing because of all the branching (gotos). SOMEBODY out there is teaching you guys that gotoAndPlay and gotoAndStop are good to use in code. They're not.
EVERY TIME YOU PUT A GOTO IN YOUR CODE, A FAIRY DIES.
I am in the process of making some video tutorials on how to code navigations without gotos. They should be done tonight. When they are, I'll post a link.
Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com