Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 7:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Passing variables from external text file
PostPosted: January 7th, 2005, 3:07 pm 
Offline

Joined: January 4th, 2005, 5:33 pm
Posts: 1
Currently I am working on a project that requires the user to input five winning numbers. I have built a keypad (digits 0-9) and displayed the numbers on screen as selected by keypad.....so far so good...Only one set of numbers (entered via an enter button) causes a video to play etc.....Here's my problem: the client wants to dynamically update the winning numbers in the pub after publication. (He doesn't want me to do it.) The only way I can see to do this (simply) is thru a text file.....But I don't think OPUS can do this....Or can it? I know this can be done in Flash. The finished Pub has to be ported to CD-ROM and web....I am nervous about how this would port to swf format via OPUS
Sooooo.....Can I pass variables from a text file to OPUS pub or is there some other way? Any help here would be most appreciated. Do not want to use Flash here....
Am using version 2.81
thanks
R. Wilson


For this message randy has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: January 7th, 2005, 6:09 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
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


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group