Thank you for your suggestion but I'm already using the way you suggested . Here is my code.
home.xml
<interface>
<field id="showContent" type="node" alias="shows.gridContent" />
<field id="subscriptionStep1" type="string" alias="step1.action" onChange="subscriptionStep1event" />
<field id="subscriptionStep2" type="string" alias="step2.action" onChange="subscriptionStep2event" />
</interface>
<children>
<Rectangle
id = "firstpage"
width="1280"
height="720"
visible="true"
color="0x000000FF"
>
</<Rectangle >
<shows
id="shows"
visible="false"
translation="[0,0]" />
<Button
id = "trial"
text = "START YOUR FREE TRIAL NOW "
showFocusFootprint = "true"
translation = "[120,450]"
focusedTextColor="0x800000FF"
textColor="0xFFFFFFFF"
minWidth = "240" />
<step1
id="step1"
visible="false"
translation="[0,0]" />
<step2
id="step2"
visible="false"
translation="[0,0]" />
home.brs
sub init()
m.firstpage = m.top.findNode("firstpage")
m.step1 = m.top.findNode("step1")
m.step2 = m.top.findNode("step2")
m.trial.ObserveField("buttonSelected", "startsignup")
end sub
function startsignup()
m.step1.visible=true
m.step1.setFocus(true)
end function
function subscriptionStep1event()
currentval = m.top.subscriptionStep1
? "transition";currentval
if currentval = "accept"
m.step2.visible=true
m.step1.visible=true
m.step2.setFocus(true)
end if
if currentval = "cancel"
m.firstpage.visible= true
end if
end function
step1.xml
<component name="step1" extends="Group" initialFocus="submit" >
<!-- main handler -->
<script type="text/brightscript" uri="pkg:/components/screens/step1/step1.brs" />
<interface>
<field id="action" type="string" />
</interface>
<children>
<Group>
<ButtonGroup id="submit"
layoutDirection = "horiz"
translation = "[ 500,600]"
/>
step1.brs
m.buttongroup = m.top.findNode("submit")
m.buttongroup.buttons = [ "DECLINE", "ACCEPT" ]
m.buttongroup.ObserveField("buttonSelected","submit")
function submit()
if m.buttongroup.buttonSelected = 1 then
m.top.action="accept"
else
m.top.action="cancel"
end if
end function
I'm not sure it is the best way.I have read the roku scene graph documentation but still confused.
Can you suggest a better method ?