reverse engineering keyboard press demo

Questions and information about using Lua scripting with Storyboard

Moderator: jamiev

reverse engineering keyboard press demo

Postby DaveC426913 » Fri Jul 02, 2010 7:15 pm

I am trying to build an app much like the keyboard_press_demo.

What is this line:

local value = gre.get_data("titletext") --Get titletext contents.
When I add it to my own script, it says "ERROR ...attempt to concatenate field 'titletext' (a nil value)".

I don't find any control, property, variable or function called titletext.
DaveC426913
 
Posts: 24
Joined: Mon Jun 28, 2010 6:23 pm

Re: reverse engineering keyboard press demo

Postby jason » Sat Jul 03, 2010 8:22 pm

I think it because you need to declare the variable as a table first. So I believe this will work

local value = {}
value = gre.get_data("titletext")
User avatar
jason
 
Posts: 34
Joined: Mon Nov 02, 2009 9:53 pm

Re: reverse engineering keyboard press demo

Postby DaveC426913 » Mon Jul 05, 2010 2:57 pm

No I don't think that's the problem. My code matches the sample.

It's titletext that it can't find. It does not appear anywhere in the sample that I can tell, yet it's pulling it from somewhere.
DaveC426913
 
Posts: 24
Joined: Mon Jun 28, 2010 6:23 pm

Re: reverse engineering keyboard press demo

Postby jason » Mon Jul 05, 2010 3:18 pm

If you didn't use the correct pathing for the variable you would see an error when you tried to use it.

Does "titletext" have it's context set to Application? if not you'll need to add the layer and control of the variable to the string passed. So if "titletext" had a context of control1 and belongs to layer3 then you'd need do this

gre.get_data("layer3.control1.titletext")
User avatar
jason
 
Posts: 34
Joined: Mon Nov 02, 2009 9:53 pm


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron