It looks like you're new here. If you want to get involved, click one of these buttons!
I'm working on my first project, which is an app with three different menus. Each has several option buttons and each button needs to return a number from 1-10. I'm borrowing heavily from SoundsPlus to create my option buttons. I've got the three screens with their respective buttons but I don't know how to get the buttons to return a number. The idea in my head is; The first screen is drawn, you make a choice, the corresponding number is stored, the second screen is drawn, you make your choice, its number is added to the running total, etc. The grand total is displayed at the end.
Comments
@fasta6
Without knowing more of what you want to do, here is a simple example of rotating thru three screens and adding a value to the total based on pressing one of three buttons. Hope this gives you some idea.. If you have more questions, just ask.
My approach to this would be to use a Finite State Machine, have a look at http://codeatuts.blogspot.com.au/2012/07/tutorial-5-finite-state-machines.html
Isn't there a way to use the array which contains my choices to get the value of the choice? For example, choices = {[1] = "first option", [2] = "second option" etc. Otherwise, I'd have to write an if,then with 10 cases for the first menu, 8 for the second, and 3 for the third.
Yes - have a look here: http://lua-users.org/wiki/SwitchStatement
Alright, I'm close. In this section, I'm not getting 'soundName' in the proper format. It's not comparing to the statements in the if/then statements. I think I'm getting a reference value, not the " " value. When I select anything from the first menu, my running total becomes a 3. When I select anything from the second, a 3 is added to the original 3, and ditto for the last menu. I always end up with a total of 9.
Thanks a lot for the help.