Forum Discussion

azimuth's avatar
azimuth
Reel Rookie
6 years ago
Solved

How to create/access a Label in a scene as a global variable? (Displaying messages with roInput)

I have a label in a scene, and I want to access it from main.brs.  I've tried assigning it to a global variable:     m.myLabel = m.top.findNode("myLabel")     m.global.myLabel = m.myLabel Tried th...
  • renojim's avatar
    6 years ago

    I think I know what you're trying to do, but I'm not sure.  To access a label in a scene from main.brs, you have to get to it via the scene:

    sg = createObject("roSGScreen")
    scene = sg.createScene("myScene")
    label = scene.findNode("myLabel")
    print label.text ' prints current value
    label.text = "New text" ' set label text

    -JT