Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
save time — Gideros Forum

save time

JackoJacko Member
edited July 2014 in General questions
Poryroku = Timer.new(1000, 100000)

Poryroku:addEventListener(Event.TIMER, function(e)
local Poryroku:getCurrentCount() = dataSaver.loadValue("Poryroku:getCurrentCount()")
print("TIMER", Poryroku:getCurrentCount())
dataSaver.saveValue("Poryroku:getCurrentCount()", Poryroku:getCurrentCount())

end)
Poryroku:start()
stage:addEventListener(Event.MOUSE_DOWN, function()
if Poryroku:isRunning() then
Poryroku:stop()
Poryroku:reset()
Poryroku:start()

end
end)



i want to save and load my actual time but it didnt work

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Your problem lies in line:
    local Poryroku:getCurrentCount() = dataSaver.loadValue("Poryroku:getCurrentCount()")
    You can't set current count, you can only reset it.
    But what you can control, is the repeatition count, so you would need to base your logic around it

    http://docs.giderosmobile.com/reference/gideros/Timer/setRepeatCount#Timer:setRepeatCount
Sign In or Register to comment.