Hi,
Thank you for your enquiry.
Opus provides a series of Storage actions allowing you to write the values of variables to text files and read information from external text files into publication variables. Please find below a link to download a sample publication which should act in the way you require.
Please extract the contents of this zip folder to your Desktop. This should give you an Opus publication named code.imp and a text file named code.txt containing the code 98765.
Now open the publication file into Opus and look at the actions for Page 1. You will see that I have applied an On Show trigger followed by a Read from Disk File action, which retrieves the contents of the code.txt file and stores the result to a variable named 'code'.
I have then used a series of script actions to take each character of the code and store each to a separate variable. The first character (in this case, 9) is stored to a variable named 'a', the second character is stored to a variable named 'b' and so forth.
These script actions may seem a little complex, but this allows the original code to be typed in as 5 consecutive digits rather than having to be formatted in any special way. If you did not want to use script actions, you could ask the user to type each digit of the code on a separate line of the text file, then use 'Read next line from file' actions to populate the five variables.
I have then created an interface which allows the user to change five variables named 'user1', 'user2', 'user3', 'user4' and 'user5'.
The next step was to add a 'Try' button which compares each of the user variables to the corresponding 'a', 'b', 'c', 'd' or 'e' variable. If all five variables match, a hidden 'Congratulations' text box is shown. If not, a hidden 'Bad Luck' text box is displayed.
Your client can change the code by simply editing the code.txt file, although the publication will need to be restarted to acknowledge this alteration.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,
You do not have the required permissions to view the files attached to this post.
_________________ Robin Garrett
Digital Workshop Technical Support
For this message Robin Garrett has been thanked by : mackavi
|