Site hosted by Angelfire.com: Build your free website today!

 

The Lingo I used in my Artifact

 

1)

global amounttopay,input

on startMovie
the floatprecision = 2
member("tickettop1").text = ""
end

The above lingo was used on the amount to pay text box which was in the Internal cast as number 70

2)

on buttonclick
thisOne = the clickON
sprite(thisOne).locH = sprite(thisOne).locH +3
sprite(thisOne).locV = sprite(thisOne).locV +3
updateStage

repeat while the mouseDown = TRUE
nothing
end repeat

sprite(thisOne).locH = sprite(thisOne).locH -3
sprite(thisOne).locV = sprite(thisOne).locV -3
updateStage

end buttonclick

The code above shows the code of the location of the button and the size of it on the stage

3)

on ticketButtonPush
thisOne = the ClickOn
case (thisOne) of
9: go to frame "pay"
member("tickettop1").text = "City - Please pay £..."
amounttopay = ....

This button shows the code for the time when clicking the city. It also shows the internal sprite number which is under the 'case'. It also shows the cost of the ticket depending on what city has been clicked on.

4)

on calculatepay
input = member("amount of money").text
if input < amounttopay then
alert "You have entered an incorrect amount, please re-enter!"
member("amount of money").text = ""
else
if input = amounttopay then
go to frame "thankyou"
else
output = input - amounttopay
go to frame "change"
member("moneychange").text = string(output)
end if
end if
end

This is the main lingo script. This shows the calculation between the amount of money entered for a city. It then calculates the amount required and the amount entered. If the amount is less then the amount to pay then an alert box appears displaying that an incorrect amount has been entered and please re-enter. If the correct amount has been entered then a 'thank you' message is displayed. If the amount entered is higher then the amount required then a calculation of the amount to pay is subtracted from the amount entered and then the 'change' is displayed with the correct change.