Skip to main content

handleLoadingSceneAction

Description​

Communicates loading actions to your app. This field allows the SDK to signal loading states that your application can respond to.

Type​

string

Usage​

m.lib.observeField("handleLoadingSceneAction", "onHandleLoadingSceneAction")

function onHandleLoadingSceneAction(event as Object)
action = event.getData()
print "Loading scene action: " + action
' Handle loading state in your app
end function

Example​

sub setupSDK()
m.lib = createObject("roSGNode", "MaestroPanelLib:MaestroPanel")

' Observe loading scene actions
m.lib.observeField("handleLoadingSceneAction", "onHandleLoadingSceneAction")

m.lib.config = {
siteID: "your-site-id",
eventID: "your-event-id",
useProdEnv: true
}

m.top.appendChild(m.lib)
end sub

function onHandleLoadingSceneAction(event as Object)
action = event.getData()

' Handle different loading actions
if action = "show_loading" then
m.loadingSpinner.visible = true
else if action = "hide_loading" then
m.loadingSpinner.visible = false
end if
end function

Best Practices​

  • Use this field to show loading indicators in your application
  • Ensure loading states are properly cleared
  • Provide visual feedback to users during SDK operations