Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Previous Button just don't get it... 1

Status
Not open for further replies.

jazzz

Technical User
Feb 17, 2000
433
US
Hello, I am new to actionscript and I am lost. I have a flash movie which has a Next button and Reply button, which I copied the code from a book and they work fine.

Now I would like to add a previous button so the user can return to the previous screen but I am having no luck. I have a layer, which I placed the name screen1, screen2 etc. I created a graphic and converted it to a button Symbol and named it previous_btn and included it in the same layer as the btn_next. I have an actionscript layer that holds the following code for the next button.

next_btn.onRelease = function() {
gotoAndStop("screen3");
};

Now what I would like to do is have my previous button return to screen2 and that is where I am lost. If anyone can recommend a good book on actionscript or website I would appreciate it.


Life's a journey enjoy the ride...

jazzz
 
previous_btn.onRelease = function() {
gotoAndStop("screen2");
};
 
Bill I tried that but it does nothing. However, since I have a layer with the next button in it do I need to create a New layer for the previous button or can I place it in with the next (I placed it in with the next button now)?

Also I have a layer for actionscript and added the code you have mentioned to the next line in my actionscript layer below the next code. Can this go in there or does it need to be elsewhere?

Life's a journey enjoy the ride...

jazzz
 
for the code to work you must have a frame labeled screen2.

you will see that you have a frame labeled screen3 (that works , right) so name the frame that you want the previous btn to goto to screen2 and all ought to be well
 
Thank you Bill, I do have one named screen two but when I click the control to move to the previous screen2 I don't go anywhere. I guess I need to play around with it more and try to figure out why it isn't working.

Life's a journey enjoy the ride...

jazzz
 
Bill, I just had time to study my code and I can now confirm I am an idiot. I was placing the current screen number in the previous control instead of the correct one. For example I looked at gotoAndStop("Screen9")that is used on the Next control and used Screen8 as the previous when in reality I am on screen8 I needed to place screen7 on the previous control and it worked just fine.

Thank you for your patience and understanding; I appreciated it.

Life's a journey enjoy the ride...

jazzz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top