Forum Discussion

ryanthompson's avatar
ryanthompson
Channel Surfer
6 years ago

Trying to create roUrlTransfer object with ComponentLibrary

I need some help because I'm stuck.  I've been writing using ComponentLibrary. See:

https://developer.roku.com/docs/references/scenegraph/control-nodes/componentlibrary.md

I cannot create an roUrlTransfer object.  As a proof of concept, I edited the ComponentLibrary.zip sample code here:

https://github.com/rokudev/samples/tree/master/utilities

I added these two lines

    transfer = CreateObject("roUrlTransfer")
    print "transfer "; transfer

The output was:

transfer invalid

Does this mean that you cannot create this of type roUrlTransfer in component libraries?

3 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert

    You can only create roUrlTransfer in the main loop or a task node.

    • ryanthompson's avatar
      ryanthompson
      Channel Surfer

      Thanks for the quick response.

      In my component library I was trying to send a tracking pixel.  Essentially send some data via a url.

      Since roUrlTransfer is not available, is there a recommended way to send a tracking event or ping a dynamic URL?

       

      • nickchavez's avatar
        nickchavez
        Binge Watcher

        I wonder if it would work to spawn a Task node from the Component Library's main Component?