Page 1 of 1

How to Go Back X Frames Tutorial

PostPosted: Fri Jan 16, 2009 9:25 pm
by cpkspikyhair
----------------------------------
HOW TO GO X FRAMES BACK
----------------------------------

This is a tutorial on how to go X frames back. First, create these variant variables:

Code: Select all
0back
1back
2back
3back
4back
5back

Then, in all of the frames of your project (except the first one), have this executed when the frames are loaded:

Code: Select all
5back = 4back
4back = 3back
3back = 2back
2back = 1back
1back = 0back
0back = Action.GetCurrentFrameName


In the first frame, place this code:

Code: Select all
5back = Action.GetCurrentFrameName
4back = Action.GetCurrentFrameName
3back = Action.GetCurrentFrameName
2back = Action.GetCurrentFrameName
1back = Action.GetCurrentFrameName
0back = Action.GetCurrentFrameName


On the hotspot where you want to be taken to a frame when it is clicked, place this code:

Code: Select all
Action.GoToFrame = Xback


Where X is the amount of frames you want to go back (up to 5).

Hope this hels anyone that needs it!

PostPosted: Sat Jan 17, 2009 12:15 am
by pennsteve
Maybe I am not understanding this, but why go to all that trouble when you can simply go to hotspot properties and choose the destination when its clicked?

PostPosted: Sat Jan 17, 2009 1:07 am
by cpkspikyhair
The reason is if you go from an unknown frame to another frame and then another frame, then you may want to go back to the unknown frame. It wouldn't be possible without a code like this.

PostPosted: Sat Jan 17, 2009 1:23 pm
by Lyberodoggy
This might be usefull too:
For the last code

Set framevarref=GetVariableReferenceFromName(number+"back")
Action.GoToFrame = framevarref.value

where by replacing number you get the value of the variable you want.