I'm asking a very dumb question I know. But I tried many ways but did not get the correct solution for this.
My Question is How to close and open a new Scene inside of the main My Code is :
sub StartSGDEXChannel(componentName, args)
m.screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
m.screen.SetMessagePort(m.port)
scene = m.screen.CreateScene(componentName)
scene.SetCertificatesFile("pkg:/certificates/cacert.crt")
scene.InitClientCertificates()
m.screen.Show()
scene.ObserveField("exitChannel", m.port)
scene.launch_args = args
scene.signalBeacon("AppLaunchComplete")
while (true)
msg = Wait(0, m.port)
msgType = Type(msg)
?"SGDEX :: msgType : "msgType
if msgType = "roSGScreenEvent"
if msg.IsScreenClosed() then return
else if msgType = "roSGNodeEvent"
field = msg.getField()
data = msg.getData()
if field = "exitChannel" and data = true then
'Here I'm trying to do close the Main Scene and Open a new Scene.
'I write below line it's close whole App
m.screen.close()
'I created one Sperate component and tried But it's not Working
m.scene = m.screen.CreateScene("SampleExample")
m.screen.show()
m.scene.setFocus(true)
end if
end if
end while
end sub
Anyone, Please suggest or guide me on how to do this type of thing in Roku?