Skip to first unread message

Jed Weissberg

unread,
Apr 18, 2015, 9:36:45 AM4/18/15
to mitappinv...@googlegroups.com
I am trying to show my students how to change screens on a button click in App Inventor 2
I have two screens "Screen1" "Screen2"
Each screen has a background image
On Screen1 I have a button set to invisible - button1
For button1 I have a block 'When Button1 Click
Do "Open another screen"
My problem is: How do I enter screen2 as the other screen to enter. When I select the only option i get is screen1

SteveJG

unread,
Apr 18, 2015, 9:57:45 AM4/18/15
to mitappinv...@googlegroups.com
=================
sWITCHING screens

1) You create a second screen on the Designer screen.
2) You name that screen ...perhaps  MyNewScreen
3) Put the following code in the Button's event handler:
    open another screen   screenName  =   MyNewScreen  in a violet Text block  ; be careful, if the Screen is called Screen2, you must type Screen2, not screen2 .  

However, this is simplified.  If you continually switch back and forth between screens, eventual your system memory will fill up and your app will crash unless you learn how to also close screens properly when you exit them ... that is described in the following two links and you need to read about possible problems of doing this


and 


Pick one of the two methods.


============

Jed Weissberg

unread,
Apr 18, 2015, 5:55:23 PM4/18/15
to mitappinv...@googlegroups.com
Thank you 
Perfect solution
Reply all
Reply to author
Forward
0 new messages