Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error in Game

Posted on 2004-09-03
1
Medium Priority
?
256 Views
Last Modified: 2013-12-24
I have managed to add clues to a game of hangman that I have been making, the game works fine and the clues appear.  However at certain points I am getting an error message saying:

Script error string expected
member("clue").text = clueList[gHangmanWord]
member 154 of castlib 1

Its obviously got something to do with the ("clue") but this is the name of my text field that the clues are appearing in. And its working fine and then it just comes to a point and this message appears and i dont know why.

The full code I have is:
global gHangmanWord

on exitFrame me
  gHangmanWord = getHangmanWord()
  showClue()
  letterList = []
  repeat with x = 1 to gHangmanWord.char.count
    letterList.add(gHangmanWord.char[x])
  end repeat
  sendAllSprites(#assignLetter, letterList)    
end

on getHangmanWord
  pickText = member("hangmanWords").text
  howManyLines = pickText.line.count
  repeat with x = howManyLines down to 1
    if pickText.line[x] = "" then delete pickText.line[x]
  end repeat
  thisOne = random(howManyLines)
  return pickText.line[thisOne]
 
end



on showClue
  clueList = ["Ice": "Clue: Its cold", "Sea": "Clue: Another name for the ocean", "Isostatic": "Clue: Word that means the land surface itself rises or falls relative to the sea", "Eustatic": "Clue: Worldwide changes in sea levels", "Kilmartin" : "Clue: Name of the place that the presentation is based on", "Earth" : " Clue: Name of the planet that we are living on", "Glacier" : "Clue:  A slowly moving mass of ice", "Mountain" : "Clue:  The name for a very high hill", "Valley" : "Clue: Low land between hills and mountains", "Woodland" : "Clue: Land that is covered with trees and shrubs", "River" : "Clue: A large stream of water that flows along a certain path", "Coastline" : "Clue: The line that separates a land surface from an ocean or sea", "Past" : "Clue: The time that has elapsed", "Climate" : "Clue: The weather in a place over a long period of time", "Wildlife" : "Clue: Animals located in the wild ", "Rock" : " Clue:  A naturally formed aggregate of usually inorganic materials from within the Earth", "Landscape" : " Clue:  An expanse of scenery that can be seen in a single view", "Pollen" : "Clue:  A fine, powdery substance released by plants and trees", "Iceberg" : " Clue: A large piece of floating ice that has broken off of a glacier", "Village" : "Clue: A settlement smaller than a town"]
  member("clue").text = clueList[gHangmanWord]
end








0
Comment
Question by:Angela123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
MediaMacros earned 200 total points
ID: 11972230
YOu probably have it picking a word that is not in the list or that is mistyped.  Remember that property lists are case sensitive.  To prevent the error you might try this..

member("clue").text = string(clueList[gHangmanWord])

Or better yet make the clueList global then change the code for picking the word like this.

global clueList
on getHangmanWord
  r = random(clueList.count)
  return clueList.getPropAt(r)
end
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question