Can anyone tell me how to alter the following script so that when the last
word has been used it will go to the next marker, (called WellDone), rather
than loop back to the start?
global gData
on prepareMovie
initData() -- initialize the global variable
member("instructions").text = SPACE
member("wordCount").text = SPACE
member("errorCount").text = SPACE -- clear the contents of all of
the fields
member("entry").text = EMPTY
member("status").text = EMPTY
member("Shield Bar").fillOffset = point(250, 0)
end
on stopMovie
gData = 0 -- clear the global variable
end
on initData
gData = [:] -- initialize the data list, and add all the properties to it
gData.addProp(#errorCount, 0) -- with their initial values
gData.addProp(#wordCount, 0)
gData.addProp(#wordList, ["potato", "lingo", "sheep", "rabbit", "cow",
"fruit", "dog", "pig", "fish", "sweet", "fire", "bird", "horse", "computer",
"spaceship", "book", "finish"])
gData.addProp(#totalWords, gData.wordList.count)
gData.addProp(#currentWord, "")
end
on startNextWord -- called to start the next word
tempWordSelection = random(gData.wordList.count) -- randomly select the
next word, and delete it from the word list
gData.currentWord = gData.wordList[tempWordSelection]
gData.wordList.deleteAt(tempWordSelection)
gData.wordCount = gData.wordCount + 1 -- increment our word count, and
update the fields on screen
member("entry").text = ""
updateFields()
end
on updateFields
member("instructions").text = "Type the word:" && gData.currentWord
member("wordCount").text = "Word" && string(gData.wordCount) && "of" &&
string(gData.totalWords) -- update the fields on screen with the current
numbers in the variable
member("errorCount").text = "Number of errors:" &&
string(gData.errorCount)
member("status").text = EMPTY
end
Cheers Ste
_________________________________________________________________
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/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!]