5 Replies Latest reply on Mar 13, 2008 12:23 PM by

    Quick question

      Hi guys,

      I've got a fairly basic problem which I can get around but I'm not sure which is the best way to go about it.

      In my interactive education tutorial, there is a button to "complete" the section the user has just done. When this button is pressed I want to user to go back to the main menu and the link to the section they have just completed should be a different colour.

      So basically I need an if statement saying that if the complete button has been pressed on page ..., change this sprite on beginSprite. What do you think?

      Thanks a bunch,
      Rich
        • 1. Re: Quick question
          Level 7
          A simple option might be to maintain a global list of "completed"
          sections. When the "complete" button is pressed, see whether the current
          section is already present in the list or not. If not, append it. Then
          in the #beginSprite handler for all the links, check whether their
          associated section name is present in the global list and colour
          accordingly.
          • 2. Re: Quick question
            Thanks Sean,

            Thats the kind of thing I was thinking about, but I'm not very good with storing global things, is the lingo fairly simple for this? I've used global functions to go back to the page you came from but thats about it :S

            Thanks,
            Rich
            • 3. Re: Quick question
              Xposure Interactive
              Something on the lines of;

              global g1Complete

              on mouseUp
              g1Complete = TRUE
              go to movie "menu"
              end

              On the complete button and in the menu dir;

              global g1Complete

              on startMovie
              if g1Complete = TRUE then
              sprite(linky).member.color = rgb(255, 0, 0)
              else
              nothing
              end if
              end
              • 4. Re: Quick question
                Level 7
                > Thats the kind of thing I was thinking about, but I'm not very good with
                > storing global things, is the lingo fairly simple for this?

                Something like the following (assuming you're happy to use markers names
                to denote "sections" and that you have these sections laid out in your
                score each with their own separate and distinct marker):
                -- #movie script:
                global glCompletedSections

                on prepareMovie
                glCompletedSections = []
                end

                -- "complete" button:
                global glCompletedSections

                on mouseUp me
                -- add section name to global list
                tMarker = _movie.markerList.getAProp(_movie.marker(0))
                if glCompletedSections.getPos(tMarker) = 0 then
                glCompletedSections.append(tMarker)
                end if
                _movie.go("menu")
                end

                -- menu links:
                global glCompletedSections
                property mySectionName

                on getPropertyDescriptionList
                tMarker = _movie.markerList.getAProp(_movie.marker(0))
                pdl = [:]
                pdl[#mySectionName] = [#comment: "Section name:", #format: #marker,
                #default: tMarker]
                return pdl
                end

                on beginSprite me
                if glCompletedSections.getPos(mySectionName) then
                -- colour sprite/member for link visited state
                else
                -- colour sprite/member for link un-visited state
                end if
                end

                on mouseUp me
                _movie.go(mySectionName)
                end
                • 5. Re: Quick question
                  Fantastic, thank you!