2014年7月10日 星期四

[AppInventor]Wait Function

Hi ! I'm jock36
Hi!我是偉和

Today I'm telling you App Inventor wait function
今天要交各位AppInventor 等待指令


In AppInventor there has no wait component,this cause some code become very difficult to write
在AppInventor裡面是沒有等待指令所以在寫某些程式時會變得非常困難

So I google how to make it
所以我就去爬文

Look for some example I prefer the one which using procedure
查了些範例後 我決定使用子程式的方式去撰寫wait 指令

Here's code
這裡是程式碼
So you can call this function in everywhere you want
所以之後你可以使用這子程式去控制延遲效果了

like this :
例如這樣:














I use wait function to make my phone vibrate 5 times when I click button
我使用延遲子程式去使我的手機每按一次按鈕會震動5次

If I didn't put this function it'll vibrate until end the for each loop
如果我沒放這子程式 那麼手機會持續震動直到for each迴圈結束

So now you can delay everything you want in AppInventor
看完這篇你已經會在appinventor內使用延遲指令了!

沒有留言:

張貼留言

歡迎留言!