# App hangs on splashscreen while rendering elements

**URL:** <https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519>\
**Category:** Roku Developer Program\
**Tags:** roku-developer-program\
**Created:** [July 24, 2026, 11:03pm UTC](https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519 "2026-07-24T23:03:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![867homely](https://avatars.discourse-cdn.com/v4/letter/8/4bbf92/32.png) [@867homely](https://forum.developer.roku.com/u/867homely)\
**Post date:** [July 24, 2026, 11:03pm UTC](https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519/1 "2026-07-24T23:03:34Z")

</div>

Hello,

I am new to Roku Channel development, and I am trying to build a starter channel that renders elements in and out.

I’ve included all the elements in the SceneGraph file, and initialized the proper elements through ids, but the channel now hangs at the splashscreen, and I’m not sure why.

Is this a scope issue, or something else entirely?

Any help would be appreciated.

Code:

main.brs

```auto
sub Main()
    showChannelSGScreen()
end sub

sub showChannelSGScreen()
    screen = CreateObject("roSGScreen")
    m.port = CreateObject("roMessagePort")
    screen.setMessagePort(m.port)
    scene = screen.CreateScene("MainScene")
    screen.show()

    while(true)
        msg = wait(0, m.port)
    msgType = type(msg)
        if msgType = "roSGScreenEvent"
            if msg.isScreenClosed() then return
        end if
    end while
end sub

```

MainScene.xml

```auto
<?xml version="1.0" encoding="UTF-8"?>

<component name="MainScene" extends="Scene" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">
	<!-- importing main handler -->
    <script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
    
    <children>
    
        <Label id="tempo" translation="[550, 50]" text="140" horizAlign="center" width="800" height="100" color="0xffffffff" font="font:LargeSystemFont"/>
        
        <ButtonGroup id = "metronomeButtons" />

        <PinPad 
            id = "pinPad" 
            pinLength = "3"
            secureMode = "false" />

        <SoundEffect
            id = "click"
            uri="pkg:/sounds/click.mp3"
            control="stop"
        />   
        
    </children>
</component>

```

MainScene.brs

```auto
sub initPinPad()
    metronomeButtons.visible = false
    pinPad.visible = true
    pinrect = pinPad.boundingRect()
    pcenterx = (screenwidth - pinrect.width) / 2
    pcentery = (screenheight - pinrect.height) / 2
    pinPad.translation = [pcenterx, pcentery]

    pinPad.setFocus(true)

end sub

sub initMetButtons()
    pinPad.visible = false
    metronomeButtons.visible = true

    rect = metronomeButtons.boundingRect()
    centerx = (screenwidth - rect.width) / 2
    centery = (screenheight - rect.height) / 2
    metronomeButtons.translation = [centerx, centery]

    metronomeButtons.setFocus(true)

end sub

sub init()
    m.top.setFocus(true)
    m.top.backgroundUri = ""
    m.top.backgroundColor = "0x80000000"
    
    click = m.top.findNode("click")
    tempo = m.top.findNode("tempo")
    pinPad = m.top.findNode("pinPad")

    screenwidth = m.top.width
    screenheight = m.top.height

    pinPad.visible = false

    metronomeButtons = m.top.findNode("metronomeButtons")

    metronomeButtons.buttons = ["-", "Start/Stop", "+", "Keyboard"]

    initMetButtons()

End sub

function onKeyEvent(key as String, press as Boolean) as Boolean
    result = true
    
    if press then
        if key = "OK"
            if click.state <> "playing"
                click.control = "play"
            end if
        end if
    end if
    
    return result 
end function

```

---

<div class="post-metadata">

**Author:** ![renojim](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@renojim](https://forum.developer.roku.com/u/renojim)\
**Post date:** [July 25, 2026, 7:01am UTC](https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519/2 "2026-07-25T07:01:08Z")

</div>

Welcome 867homely!

You have several problems. Are you connecting via telnet to port 8085 to see the debug output? If you were, you should see that it’s crashing on the **pinpad.visible = true** statement. That’s because **pinpad** isn’t defined. In your **init** function, you should use **m.pinpad = m.top.findNode(“pinPad”)** and then use **m.pinpad** everywhere. It’s the same thing with **metronomeButtons**.

Once you fix those things, you’ll find that **screenheight** and **screenwidth** aren’t defined. That’s because **m.top** doesn’t have a **.width** or **.height** property.

Use the debug console and work through the problems it displays one by one.

---

<div class="post-metadata">

**Author:** ![867homely](https://avatars.discourse-cdn.com/v4/letter/8/4bbf92/32.png) [@867homely](https://forum.developer.roku.com/u/867homely)\
**Post date:** [July 25, 2026, 10:56pm UTC](https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519/3 "2026-07-25T22:56:48Z")

</div>

Sorry about that. I didn’t know about the debug output, I will go ahead and fix those issues.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/roku/original/1X/92665110ea04809cc39cb0db8432a95e7b5961f3.svg) [@system](https://forum.developer.roku.com/u/system)\
**Post date:** [August 24, 2026, 10:57pm UTC](https://forum.developer.roku.com/t/app-hangs-on-splashscreen-while-rendering-elements/11519/4 "2026-08-24T22:57:41Z")

</div>

Closed on August 24, 2026, 10:57pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
