accessing a parameter value upon screen change

Questions and information about Crank Software's Storyboard Designer

Moderator: jamiev

accessing a parameter value upon screen change

Postby DaveC426913 » Tue May 17, 2011 2:35 pm

The same buttons on screenA, screenB and screenC are going to call screenD. screenD needs to know which screen to go back to once it's closed.

My intent is to pass the calling screen's name in as a parameter i.e. give each screen's 'Touch: Action Type:Screen' a custom parameter 'calling_screen:scrA'.


So:
screenA > btnGO > Action: Screen > Parameters > calling_screen (custom param): screenA
screenB > btnGO > Action: Screen > Parameters > calling_screen (custom param): screenB
screenC > btnGO > Action: Screen > Parameters > calling_screen (custom param): screenC

The question is, how can screenD access this parameter?

screenD > btnRETURN > Action: Screen > Parameters > Screen : calling_screen

Or is there a better way to do this?

I had a method where the two screens set and got an app-level variable but there's got to be a way to access that parameter directly. Alternately, I could do it using Lua, but that too seems like overkill.
DaveC426913
 
Posts: 27
Joined: Mon Jun 28, 2010 1:23 pm

Re: accessing a parameter value upon screen change

Postby jason » Thu Jun 09, 2011 9:07 am

Hi Dave,

Sorry for the slow response. This post didn't seem to trigger the notification email that we all usually get.

You'll have to use Lua in this case to keep track of your previous screen. You can simply call a Lua function to do the screen change and record the value for "mapargs.context_screen".

You can see and example of how to do a screen change from Lua here
http://cranksoftware.com/forums/viewtopic.php?f=6&t=23

Regards,
Jason
User avatar
jason
 
Posts: 102
Joined: Mon Nov 02, 2009 4:53 pm

Re: accessing a parameter value upon screen change

Postby jason » Thu Jun 09, 2011 9:11 am

Upon further reflection you could also create a text variable and on the event to cause the screen change also add a data change action that sets the variable to the current screen name. Then on your close button set the screen name for the action to your "previous_screen" variable.
User avatar
jason
 
Posts: 102
Joined: Mon Nov 02, 2009 4:53 pm

Re: accessing a parameter value upon screen change

Postby joy » Sat Jun 25, 2011 1:38 am

When you try to run a query, a form, or a report, the Enter Parameter Value dialog box may appear unexpectedly.
joy
 
Posts: 3
Joined: Thu Jun 23, 2011 9:37 pm


Return to Storyboard Designer

Who is online

Users browsing this forum: No registered users and 1 guest