Forum Discussion

squirreltown's avatar
squirreltown
Roku Guru
12 years ago

saving variable.

A lot of this is making more sense to me as i do it but this using a variable in another function has me stuck.
i have this:

curr_photo = photolist[onscreenphoto]

which used in a slideshow loop like this : curr_photo.GetTitle()

Retrieves the current slide's title. Ok fine, so I'm displaying that over the slide for a few seconds.

now I want to use this curr_photo.GetTitle() in the info dialog (*) that a user can pop up over any slide. The problem is that the info dialog is a different function and doesnt know from curr_photo.GetTitle(). trying it returns this from the debugger which seems to mean that variable is not available to that function.

'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...g:/source/mediarsstoolkit.brs(305)

305: infomenu.setTitle([curr_photo.GetTitle()])

curr_photo &h0000 <uninitialized> val:Uninitialized



The documentation wiki makes a lot of sense once you achieve a certain level of understanding which i dont have in this instance. Can someone point me to where this is explained? I have been able to make functions and call them, How can i save that variable somewhere so it can be used somewhere else?

thanks