At 7:25 AM +0000 1/4/01, Yo Gomi wrote:
>Hello list,
>I'm trying to create a back button which takes back to the last visited
>marker. Does anyone know how to return the name of the marker as a value in
>a list? Hmm it's difficult to explain so here's my script so far...
>


Here's a solution with a single global:

-- Movie script
global hitList

on startMovie
   hitList = []
end


on backButton
   nItems = count(hitList)
   if nItems < 2 then
     alert("There is nowhere to go back to")
     return
   end if
   deleteAt(hitList, nItems)  -- gets rid of the current page
   nItems = nItems - 1 -- index to previous page
   lastPage = hitlist[nItems]
   deleteAt(hitList, nItems)  -- get rid of the last page
   go frame lastPage
end


on arriveAtNewPage newPageName
   append(hitList, newPageName)
end


-- This is a frame script that goes on all your frames
-- you want to mark as visited
on beginSprite me
   thisFrameName = the frameLabel
   arriveAtNewPage(thisFrameName)
end

on exitFrame me
   go to the frame
end


-- And here is the script on the back button
on mouseUp me
   backButton()
end

Customize as you wish.

Irv

(PS:  For extra bonus points, turn this into a single global 
navigation object where "hitlist" becomes a property of the object)
-- 
Lingo / Director / Shockwave development for all occasions.

        (Over two millions lines of Lingo code served!)

[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