local alreadyLoading =false-- This is now your textlocal sizeText=nillocalfunction onComplete(event)local x = #event.data
print("size:", x )-- If the text is on the stage already then remove it if sizeText and stage:contains(sizeText)then stage:removeChild(sizeText)end-- now create your new text
sizeText = TextField.new(nil,"size : " .. x )
sizeText:setPosition(10, 265)
sizeText:setTextColor(0x007B25)
stage:addChild(sizeText)
alreadyLoading =falseendlocalfunction onError()print("error")
alreadyLoading =falseendlocalfunction load()ifnot alreadyLoading thenlocal loader = UrlLoader.new("<a href="http://www.catonmat.net/download/awk.cheat.sheet.txt"" rel="nofollow">http://www.catonmat.net/download/awk.cheat.sheet.txt"</a><img class="emoji" src="http://forum.gideros.rocks/resources/emoji/wink.png" title=";)" alt=";)" height="20" />
loader:addEventListener(Event.COMPLETE, onComplete)
loader:addEventListener(Event.ERROR, onError)
alreadyLoading = true
end
end
local timer = Timer.new(60 * 1000, 0) --it is updated every minute
timer:addEventListener(Event.TIMER, load)
timer:start()
load()
I have just run it and it loaded 45722 bytes 3 times.
Comments
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
@Scouser , ok i'm trying
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
1. Create the UI to display the information, i.e. create the textField and update this everytime you download the data
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Besides, thank everybody which helps . i appreciate them .