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: 
btray77
Visitor

CreateObject at Runtime

What is the best way to create objects at runtime?

Example I have a xml file I download which has text, screen location and color for each item to be typed out on to the canvas. Then I need to be able to use other information in the XML file to move the text or change it in some way, so I still need the handle for the item I'm creating.

Thanks

-Brad
0 Kudos
3 REPLIES 3
TheEndless
Channel Surfer

Re: CreateObject at Runtime

It's not entirely clear what you're trying to accomplish, but I think Eval() might be what you're looking for: http://sdkdocs.roku.com/display/RokuSDK ... tAsInteger
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuJoel
Binge Watcher

Re: CreateObject at Runtime

Once you have your xml file downloaded and parsed you can pass the parsed xml object or variables derived from it to any function and extract whatever relevant data from it when it is needed.

Eval is used if you want to generate and execute a line of Brightscript code within your Brightscript code, similarly, you can download and execute a whole Brightscript function or program with the Run function within your Brightscript program.

- Joel
0 Kudos
btray77
Visitor

Re: CreateObject at Runtime

I think I was able to figure out what I wanted to do looking at the dfNewBitmapSet code.

Thanks

-Brad
0 Kudos
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.