obj = createObject("roSGNode", "Node")
child = createObject("roSGNode", "ContentNode")
child.id = "foo"
obj.appendChild(child)
print obj.findNode("foo")
' invalid '
print obj.getChildCount()
' 1 '
print obj.getChild(0)
' <Component: roSGNode> = '
' { '
' change: <Component: roAssociativeArray> '
' focusable: false '
' focusedChild: <Component: roInvalid> '
' id: "foo" '
' } '
When testing I tried the above and found that appendChild() does appear to be adding the child to the obj but findNode() dose not find it. I did some more testing such as:
obj = createObject("roSGNode", "Node")
child = obj.createChild("ContentNode")
child.id = "foo"
print obj.findNode("foo")
print obj.getChildCount()
print obj.getChild(0)
I also got the same results again.
Finally I tried to create the obj node using m.top.createChild() and it worked:
obj = m.top.createChild("Node")
child = createObject("roSGNode", "ContentNode")
child.id = "foo"
obj.appendChild(child)
print obj.findNode("foo")
' <Component: roSGNode> = '
' { '
' change: <Component: roAssociativeArray> '
' focusable: false '
' focusedChild: <Component: roInvalid> '
' id: "foo" '
' } '
print obj.getChildCount()
' 1 '
print obj.getChild(0)
' <Component: roSGNode> = '
' { '
' change: <Component: roAssociativeArray> '
' focusable: false '
' focusedChild: <Component: roInvalid> '
' id: "foo" '
' } '
All tests where done after:
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("Main")
screen.show()
This leads me to believe this may be a bug of some sort.