2

With the use of Task inside a Scene, we got response from a api. But how to access the response of Task from main.brs?

Can we change the scene from a scene in a scenegraph? I could not figure that. Or can we only change the scene from main.brs?

Ajay Paudel
  • 322
  • 1
  • 12

1 Answers1

1

If your scene has the response as a string variable you can pass values using the interface fields in the xml file. You can try doing something like this.

In Scene.brs

  m.top.response = response

In Scene.xml

<interface>
  <field id="Response" type="String" alias="m.top.response" />
</interface>

then later on in your main.brs

m.sampleScene = m.top.FindNode("Scene")]
print(m.sampleScene.response)