Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong code

Status
Not open for further replies.

ebony4

Technical User
Apr 23, 2004
10
GB
I am trying to create a behaviour that when the movie is playing the user clicks the sprite and the number of points will be added to the the global variable called
'points' which contains the player's current score. Also, an alert box should appear with a message telling the user how many points scored. But i keep getting the message "Script error: handler definition
expected" Behaviour------------------------?
Do i need to edit anything ?



---------------------------point scoring
behaviour--------------------------------------
global points

property pointsForThisSprite

on mouseup me
points = points + pointsForThisSprite
alert("You scored "&pointsForThisSprite&" points!")
end

on getPropertyDescriptionList me
pdlist = [:]
pdef = [#comment: "Number of points for this sprite", #format:#integer,
#default: 0]
addprop pdlist,#pointsForThisSprite,pdef
return pdlist
end
----------------------------------------------------------------------------------------




 
There's nothing wrong with the script so it should work. Make sure the script is set to Behaviour script and attached to a sprite.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top