Your Digital Media Has Never Looked So Good

 
mkdir1995
Topic Author
Posts: 34
Joined: Tue Feb 14, 2017 10:15 am

Back button on Detail Screen in SceneGraph

Tue Feb 06, 2018 3:03 pm

I'm trying to implement a "go back" button on the detail screen using SceneGraph to go back to the Grid Screen. My code is based off the Simple Grid with Details and Video example.
I have 2 buttons: "Play" and "Go Back." Play works just fine, but when I try to go back, nothing happens - I just get a blank gray screen with no error.


DetailScreen.xml
<children>
      <GridScreen
        id="GridScreen"
        visible="false"
        translation="[0,0]" />


DetailScreen.brs
 m.gridScreen        =   m.top.findNode( "GridScreen" )

sub onItemSelected()
  ' first button is Play
  ' second button is to Go Back

  if m.top.itemSelected = 0
    m.videoPlayer.visible = true
    m.videoPlayer.setFocus( true )
    m.videoPlayer.control = "play"
    m.videoPlayer.observeField( "state", "OnVideoPlayerStateChange" )
  end if

  if m.top.itemSelected = 1 
    print "I have selected the GO BACK button"
    m.gridScreen.visible = "true"
    m.gridScreen.setFocus( true )
    m.top.visible = "false"
  end if
End Sub


What am I missing here? Any help would be appreciated.
Thanks!
 
User avatar
squirreltown
Posts: 829
Joined: Sun Apr 21, 2013 2:20 pm

Re: Back button on Detail Screen in SceneGraph

Tue Feb 06, 2018 3:17 pm

    m.top.visible = "false"

Possible culprit ?
Kinetics Screensavers
 
mkdir1995
Topic Author
Posts: 34
Joined: Tue Feb 14, 2017 10:15 am

Re: Back button on Detail Screen in SceneGraph

Tue Feb 06, 2018 3:34 pm

squirreltown wrote:
    m.top.visible = "false"

Possible culprit ?

@squirreltown - I thought it might be, but when I remove it, it still doesn't work. Instead it stays stuck on the detail screen.
 
tim_beynart
Posts: 227
Joined: Wed Jul 15, 2015 8:30 am

Re: Back button on Detail Screen in SceneGraph

Wed Feb 07, 2018 1:18 pm

m.gridScreen.visible = "true"

shouldn't that be a boolean (in other words, no quotes)? I'm just guessing here.
 
User avatar
squirreltown
Posts: 829
Joined: Sun Apr 21, 2013 2:20 pm

Re: Back button on Detail Screen in SceneGraph

Thu Feb 08, 2018 8:00 am

tim_beynart wrote:
m.gridScreen.visible = "true"

shouldn't that be a boolean (in other words, no quotes)? I'm just guessing here.

Weirdly, this one works both ways. Probably so you can use values right out of the registry.
Kinetics Screensavers
 
mkdir1995
Topic Author
Posts: 34
Joined: Tue Feb 14, 2017 10:15 am

Re: Back button on Detail Screen in SceneGraph

Thu Feb 08, 2018 9:11 am

squirreltown wrote:
tim_beynart wrote:
m.gridScreen.visible = "true"

shouldn't that be a boolean (in other words, no quotes)? I'm just guessing here.

Weirdly, this one works both ways. Probably so you can use values right out of the registry.

I was actually wondering why some are in quotes and some aren't, and tried both. neither worked  :( 

Who is online

Users browsing this forum: No registered users and 1 guest