How I can change the image when click the button?

33 views
Skip to first unread message

Moosa Alismaili

unread,
Nov 5, 2019, 9:48:08 AM11/5/19
to MIT App Inventor Forum

11111111.png


. Hi dear I'm beginning in MIT app Inventor I do switch button in this button image  
I want when click to button change the image
I hope clear to you

TimAI2

unread,
Nov 5, 2019, 10:49:20 AM11/5/19
to MIT App Inventor Forum
Just one other image ?
Or do you want to pick from a list ?
Or do you want the image to change to a different image each time you click ?

Moosa Alismaili

unread,
Nov 5, 2019, 11:35:24 AM11/5/19
to MIT App Inventor Forum
Yes
I want the image to change to a different image
When click the button?
I mean two image one as default and the other when click?

TimAI2

unread,
Nov 5, 2019, 12:11:51 PM11/5/19
to MIT App Inventor Forum
Like so:

blocksButtonImageChange.png


Moosa Alismaili

unread,
Nov 5, 2019, 1:07:09 PM11/5/19
to MIT App Inventor Forum
From where get if_than_else

Moosa Alismaili

unread,
Nov 5, 2019, 1:09:36 PM11/5/19
to MIT App Inventor Forum
32222.png

Taifun

unread,
Nov 5, 2019, 1:42:39 PM11/5/19
to MIT App Inventor Forum
From where get if_than_else



A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         


Moosa Alismaili

unread,
Nov 5, 2019, 2:37:28 PM11/5/19
to MIT App Inventor Forum
Thanks a lot

Now  How I can make the button switch one time only
I mean if click again nothing happen 
455555.png

Moosa Alismaili

unread,
Nov 5, 2019, 3:01:19 PM11/5/19
to MIT App Inventor Forum
I solve this by this way
Now How I can refresh the app without close and open the application again ?
 when I do like the attach file if i need use the switch again most be close and open I want add a new button when  press refresh app 
56666.png

Moosa Alismaili

unread,
Nov 5, 2019, 11:34:54 PM11/5/19
to MIT App Inventor Forum
I mean How I can add refresh Button ?
No need to close the application and open again

TimAI2

unread,
Nov 6, 2019, 3:43:39 AM11/6/19
to MIT App Inventor Forum
This might work for you. Use a true/false variable, and a long click event on the button to save having to introduce another button component to reset

blocksbuttonreset.png


Reply all
Reply to author
Forward
0 new messages