AppInventor: Tutorial Start dan Stop File Sound
Jump to navigation
Jump to search
Sumber: http://www.appinventor.org/content/howDoYou/Conditionals/startStop
This behavior from the I Have a Dream app illustrates the fundamental way that an app makes decisions. There is a button with a picture of Martin Luther King on it. The action taken when the button is clicked is not always the same. If the sound file (MLK’s speech) is playing, it should be paused. If it is not playing, it should be started. The if-else block is used to branch based on the situation. It checks the IsPlaying property of the Player component. If it is true, it pauses the speech. If it is false (else), the speech is (re-) started.