Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reika1
Newbie

roUrlTransfer Not Working "Dot Operator attempted with invalid BrightScript Component or interface"

Do you know guys why I'm getting that error? I've doing my research but I didn't found anything that solves my problem and the debugger it's not clear.Doesn't matter what URL I type, I always get error except if I use the next in main.brs: 

url = "https://community.roku.com/"

x = CreateObject("roUrlTransfer")

x.SetUrl(url)

MainScene.xml
<?
xml version="1.0" encoding="utf-8" ?>
<component name="MainScreen" extends="Scene">
<script type="text/brightscript" uri="MainScene.brs" />
<script type="text/brightscript" uri="UILogic/StackLogic.brs" />
<script type="text/brightscript" uri="UILogic/RunTaskLogic.brs" />
<script type="text/brightscript" uri="UILogic/ShowLoginForm.brs" />
<script type="text/brightscript" uri="UILogic/UrlTransfer.brs" />
<children>
<Overhang
id="overhang"
title="Wubbix"
showOptions="false"
showClock="true"
logoUri="pkg:/images/logo64.png"
translation="[0,0]"
opacity="0.66"
color="0x101010FF"
/>
<Label
id="myLabel"
width="1280"
height="720"
translation="[0,0]"
horizAlign="center"
vertAlign="center"
/>
</children>
</component>
MainScene.brs
sub init()
tittleSize = 50
textColor = "0x94001BFF"
m.myLabel = m.top.findNode("myLabel")
m.myLabel.font.size=tittleSize
m.myLabel.color=textColor
m.myLabel.text="hola"
m.myLabel_Size= m.myLabel.boundingRect()
m.MainScreen = CreateObject("roSGNode","MainScreen")
MainScreen_Size = m.MainScreen.boundingRect()
GetAsync("https://community.roku.com/")
InitScreenStack()
ShowLoginForm()
RunContentTask()
end sub

 

Output:

 

DebugServer: Adding stop statements for active breakpoints
DebugServer: Creating zip archive from project sources
DebugServer: Connecting to Roku via telnet at 192.168.100.7:8085
DebugServer: Error connecting to port 8080: connect ECONNREFUSED 192.168.100.7:8084
08-16 20:51:01.756 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
08-16 20:51:01.756 [beacon.signal] |AppCompileInitiate --------> TimeBase(0 ms)
08-16 20:51:01.758 [scrpt.cmpl] Compiling 'Wubbix', id 'dev'
08-16 20:51:01.762 [scrpt.load.mkup] Loading markup dev 'Wubbix'
08-16 20:51:01.764 [scrpt.unload.mkup] Unloading markup dev 'Wubbix'
08-16 20:51:01.767 [scrpt.parse.mkup.time] Parsed markup dev 'Wubbix' in 5 milliseconds
------ Compiling dev 'Wubbix' ------
BRIGHTSCRIPT: WARNING: unused variable 'focusedindex' in function 'onitemfocused' in pkg:/components/LoginScreen/LoginScreen.brs(10)
BRIGHTSCRIPT: WARNING: unused variable 'mainscreen_size' in function 'init' in pkg:/components/MainScene.brs(1)
BRIGHTSCRIPT: WARNING: unused variable 'video' in function 'getitemdata' in pkg:/components/tasks/MainLoaderTask.brs(14)
Displayed 3 of 3 warnings
08-16 20:51:01.784 [scrpt.ctx.cmpl.time] Compiled 'Wubbix', id 'dev' in 17 milliseconds (BCVer:0)
08-16 20:51:01.785 [scrpt.proc.mkup.time] Processed markup dev 'Wubbix' in 0 milliseconds
08-16 20:51:01.795 [beacon.signal] |AppCompileComplete --------> Duration(40 ms)
08-16 20:51:01.802 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
08-16 20:51:01.805 [beacon.signal] |AppSplashInitiate ---------> TimeBase(3 ms)
08-16 20:51:02.612 [beacon.signal] |AppSplashComplete ---------> Duration(806 ms)
08-16 20:51:02.775 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
08-16 20:51:02.790 [scrpt.cmpl] Compiling 'Wubbix', id 'dev'
08-16 20:51:02.802 [scrpt.load.mkup] Loading markup dev 'Wubbix'
08-16 20:51:02.804 [scrpt.unload.mkup] Unloading markup dev 'Wubbix'
08-16 20:51:02.811 [scrpt.parse.mkup.time] Parsed markup dev 'Wubbix' in 9 milliseconds
------ Compiling dev 'Wubbix' ------
BRIGHTSCRIPT: WARNING: unused variable 'focusedindex' in function 'onitemfocused' in pkg:/components/LoginScreen/LoginScreen.brs(10)
BRIGHTSCRIPT: WARNING: unused variable 'mainscreen_size' in function 'init' in pkg:/components/MainScene.brs(1)
BRIGHTSCRIPT: WARNING: unused variable 'video' in function 'getitemdata' in pkg:/components/tasks/MainLoaderTask.brs(14)
Displayed 3 of 3 warnings
08-16 20:51:02.834 [scrpt.ctx.cmpl.time] Compiled 'Wubbix', id 'dev' in 22 milliseconds (BCVer:0)
08-16 20:51:02.834 [scrpt.proc.mkup.time] Processed markup dev 'Wubbix' in 0 milliseconds
08-16 20:51:02.835 [beacon.signal] |AppCompileComplete --------> Duration(54 ms)
------ Running dev 'Wubbix' main ------
08-16 20:51:03.132 [scrpt.ctx.run.enter] UI: Entering 'Wubbix', id 'dev'
in showChannelSGScreen
BRIGHTSCRIPT: ERROR: roUrlTransfer: creating MAIN|TASK-only component failed on RENDER thread: pkg:/components/UILogic/UrlTransfer.brs(6)
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Suspending threads...
Thread selected: 1* ...nents/UILogic/UrlTransfer.brs(7) request.SetUrl(url)
Current Function:
005: Function GetAsync(url as String)
006: request = CreateObject("roUrlTransfer")
007:* request.SetUrl(url)
008: request.AsyncGetToString()
009: requestId = request.GetIdentity().ToStr()
010: m.pendingXfers[requestId] = request
011: End Function
Source Digest(s):
pkg: dev 1.0.1 2ad9324e Wubbix
pkg: 632126 1.0.2 7132d6d9 libplayready
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/components/UILogic/UrlTransfer.brs(7)
Backtrace:
#1 Function getasync(url As String) As Dynamic
file/line: pkg:/components/UILogic/UrlTransfer.brs(7)
#0 Function init() As Void
file/line: pkg:/components/MainScene.brs(28)
Local Variables:
url String (VT_STR_CONST) val:"https://community.roku.com/"
global Interface:ifGlobal
m roAssociativeArray refcnt=3 count:5
request Invalid
requestid <uninitialized>
Threads:
ID Location Source Code
0[u] pkg:/source/main.brs(1) subMain()
1* ...nents/UILogic/UrlTransfer.brs(7) request.SetUrl(url)
*selected [u]unattached(not debuggable)
Brightscript Debugger>
Thread attached: pkg:/source/main.brs(12) screen.show()
 
 

IMG:

error.jpeg

0 Kudos
1 REPLY 1
Chris-DP
Binge Watcher

Re: roUrlTransfer Not Working "Dot Operator attempted with invalid BrightScript Component or in

You can’t create these objects in the render thread. You can only make them in main or Tasks. So that error is that your “request” object is invalid as “CreateObject” failed. 

https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md

Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.