creating a form to submit the score
creating a form to submit the score
(OP)
I've created a whack a mole game with a counter that adds up how many moles u manage to hit in a certain time limit. I have then created a form with the idea that the user can then type in their name and email address (the score will already be carried on from previous page) and submit their score. I've read up on how to send emails and similar and the information has to be put as a global DataList so it can be sent as one string (hopefully this is right!?)...however as you do not type the score into the field i can't get it to be part of this list!
Any ideas?
Any ideas?
RE: creating a form to submit the score
Kenneth Kawamoto
www.materiaprima.co.uk
RE: creating a form to submit the score
This is the code attached to the fields (I adapted it from a tutorial on the Internet so its possible it may be totally wrong!):
property pValidChars
property pDataField
property pMem,
global gDataList,
on getPropertyDescriptionList me
dataFieldsList = [#name, #emailAddress]
set pdlist to [:]
addprop pdlist, #pValidChars, [#comment:"Valid chars", #format:#string, #default:"abcdefghijklmnopqrstuvwxyz 0123456789 @."]
addprop pdlist, #pDataField, [#comment: "Which data?", #format:#symbol, #default: #firstname, #range: dataFieldsList]
return pdlist
end
on beginSprite me
pMem = sprite(me.spriteNum).member
pMem.text = ""
end
on keyDown me
if the key = BACKSPACE then
pass
else if pValidChars contains the key then
pass
end if
end
on storeData me
if voidP(gDataList) then
gDataList = [:]
end if
setaProp gDataList, pDataField, pMem.text,
end
i've tried adding gScore into various places but it just returns an error message.
At the moment when you click the 'submit' button you get
gDataList= [#name: "abcd", #EmailAddress: "abcd ", #score: "", <Void>: <Void>]
and as you can see it wont pick up the score!!
I've played games online where you can submit the score so it must be possible!!!!!
RE: creating a form to submit the score
gDataList[#score] = gScore
Kenneth Kawamoto
www.materiaprima.co.uk
RE: creating a form to submit the score
The only thing is it displays the score as zero all the time as it must be reading what gScore equals at the beginning of the movie.
Is it possible to say something similar to
gDataList[#score] = gScore when time = 300 seconds
or gDataList[#score] = gScore when pWin=1 ??
As you can tell i'm quite new to lingo and am not sure how to phrase things yet!!
thanks again! :)
RE: creating a form to submit the score
Kenneth Kawamoto
www.materiaprima.co.uk
RE: creating a form to submit the score
gDataList[#score] = gScore
in the on beginSprite handler in the above code as this seemed like the most sensible place
is that right?
RE: creating a form to submit the score
Kenneth Kawamoto
www.materiaprima.co.uk
RE: creating a form to submit the score
I had a look back through all my scripts and saw in some of them i had pScore and in some i had gScore!!!!
Now all I have to do is work out how to send it!
Thank you so much. Have a nice day :)