2014년 12월 10일 수요일

bad arguments to >


hi i made an app that uses tinydb to keep high score and when i test it out on Ai companion on my phone it works perfectly but when i build and scan to to my phone it gives me an error saying bad arguments to > the operation > cannot accept arguments: 30*empty-string*. i dont understand why it works on my phone ai companion app but not on the phone when i build it. basically the app is just a button and you push it as fast as possible for 15 sec and each click gives you one point. once the timer goes down to 0 the app checks to see if the global score(your current score) is higher than the value in the score in tinydb if it is it updates the tinydb score and opens a new screen and shows the score



-- 
the screenshot looks fine...

do you use the > block also somewhere else?
inside the first if statement try to set clock.TimerEnabled to false to stop the timer

-- 
That fixed it taifun but now I have a new problem. The global time is set to 15 and everytime  the clock goes off it is suppose to minus 1 until it reaches zero to simulated 15 seconds because the clock timer is 1000 millisecond, but for some reason it seemd that if I continuously press the image the clock or timer isnt going off. But if I stop pressing and wait 15 seconds it woork, which defeats the purpose of the app because it's suppose to give you 15 second to click image as much as possible. Any idea?  

here is my new updated blocks:


-- 
Probably the timer is not going of because you er-enable the timer each time you press the sprite. I assume that it resets the timer interval and therefore if you press the sprite frequently enough, the timer will not fire. Try again, after taking those two statements out. They should be in your screen initialize, or similar.

-- 
oh yea just notice that, i just cant figure out how to reset the time when i come back from the first screen. because apparently when i come back from the second screen(hi score screen) the value for global time is now 0 and i cant figure out a godo way to make it reset, i coud use a button but i rather not because it looks weird to m. any tips or ideas?

-- 
Use the following block from the "Screen" drawer in Screen1 to act upon Screen2 being closed:


-- 
see also the notes about limitations of the companion app here
The recommended method of switching screens in App Inventor
manager.aia

-- 
thanks a lot guys you were of great help and this was a great learning experience for me.

-- 

댓글 없음:

댓글 쓰기