mkdir1995
8 years agoVisitor
Conditionally displaying a different scene
Using the Simple_Grid_With_Details_and_Video example, I want to conditionally display a screen on the click of an item in the home grid. If an item matches my criteria for a detail screen, the conditional for displaying a detail screen works! But now I need to figure out the other part - if an item matches the criteria for a playlist, I want to be able to click on the item and show a different screen with a grid of items INSTEAD of a details screen. I am doing all of this inside of the OnRowItemSelected() function in HomeScene.brs.
getCategoryContent() :
...however, when calling this queryCategoryItems function, I keep getting an error that says "BRIGHTSCRIPT: ERROR: roUrlTransfer: creating MAIN|TASK-only component failed on RENDER thread". I donβt know why this works fine in the Main.brs but not within the HomeScene.brs, even though i am including all the necessary request/response files in a script tag in the homescreen.brs file. The error is in an outside file that handles the requests (line 40 below).
If there's a better way to do this, I'd love to know. I wanted to keep this in the main.brs file, but then I came across more issues when tying it to a scene and it was proving to be far more difficult than just having it done upon the press of an item. Thanks!!
Function OnRowItemSelected()
m.currentItem = m.gridScreen.focusedContent.item
if m.currentItem.type_name = "video"
m.gridScreen.visible = "false"
m.detailsScreen.content = m.gridScreen.focusedContent
m.detailsScreen.setFocus(true)
m.detailsScreen.visible = "true"
else
getCategoryContent()
m.gridScreen.visible = "false"
end if
getCategoryContent() :
function getCategoryContent()
print "I am inside of getCategoryContent()"
m.categoryItem = queryCategoryItems( m.currentItem )
print "getting the items within this category item....."
end function
...however, when calling this queryCategoryItems function, I keep getting an error that says "BRIGHTSCRIPT: ERROR: roUrlTransfer: creating MAIN|TASK-only component failed on RENDER thread". I donβt know why this works fine in the Main.brs but not within the HomeScene.brs, even though i am including all the necessary request/response files in a script tag in the homescreen.brs file. The error is in an outside file that handles the requests (line 40 below).
039: function getRequestMessagePort() as Object
040:* return m.transport.getMessagePort()
041: end function
Interface not a member of BrightScript Component (runtime error &hf3) in pkg:/source/request.brs
If there's a better way to do this, I'd love to know. I wanted to keep this in the main.brs file, but then I came across more issues when tying it to a scene and it was proving to be far more difficult than just having it done upon the press of an item. Thanks!!