What you really want to keep track of is, probably, the NAME OF THE FRAME 
where the user was before he/she clicked your Next button or made some 
other choice, e. g. from a menu of frames or features.

Frames have numbers, but you may also give every frame a name or label. You 
can type these labels in the Score, in the line above the sprite 
channels... You'd better look at your manual where it has pictures that 
illustrate frame labels.

Sure, you can save the name of the last frame your user visited in a global 
variable, as you seem to be doing. Make sure you spell the name 
consistently, e.g.

global gPreviousFrame
gPreviousFrame = "MyOpeningFrame"

The "on mouseDown" handler is not the best place for saving the frame's 
label in your global variable. Better put this in each frame's script:

on beginSprite me
   global gPreviousFrame
   gPreviousFrame = the frameLabel
end beginSprite

That way, the value of gPreviousFrame will always be accurate.

If you create a button for the user to go back to where he was just before, 
that buttons's script should be like this:

on mouseDown me
   global gPreviousFrame
   go to frame gPreviousFrame
end mouseDown

This scheme, of course, will only let your user go one step back, because 
you're saving only one "previous" frame name. It is probably more useful to 
save the entire sequence of frames that the user has visited. To do that, 
you need to learn about linear lists. Then your global variable may be, 
e.g., a list like this one:

["MyOpeningFrame", "TheLastFrame", "TheGlossaryFrame", "HelpFrame"]

and your user can go back one step or forward one step from any frame.

Slava

At 04:15 AM 9/9/2001 +0000, you wrote:

>Hi,
>
>If I wanted to keep track of the previous screen,
>
>
>my movie script reads:
>
>global gPreviousScreen
>on StartMovie
>set gPrevious = 0
>end StartMovie
>
>
>
>my sprite script ( which is a left arrow button) reads:
>
>on mousedown
>global gPreviousScreen
>CurrScreen = sprite(6) -gPreviousScreen
>sprite(6) =CurrScreen
>updatestage
>end
>
>
>Is this the way to keep track?
>
>
>Thanks for your help!
>
>
>
>
>
>
>
>
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
>email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to