Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adding more text boxes as the publication is running.
PostPosted: January 24th, 2007, 8:56 pm 
Offline

Joined: January 23rd, 2006, 6:23 am
Posts: 23
Location: Hollywood
I wrote a game program on Opus Pro 5 that uses a fixed number of text input boxes. But I want to add a feature where the game player could add more text input boxes while the game is running.

Is there an action or a script that will create more text input boxes when the user/player clicks an "add more boxes" button while the publication is running? Each new text input box will be located directly below the previous text input box and will have a text input variable name sequentially generated. And if the rows of text boxes run off the bottom of the screen, a scroll bar will be generated.


Top
 Profile  
 
 Post subject:
PostPosted: January 25th, 2007, 5:58 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

At first I thought of a complex solution involving scripting to set up clones, layers, etc. Then, I came up with a more basic idea, making use of multi frames.

I'm not sure what your design looks like, but, if you don't need an enormous number of text input boxes, then maybe you can build on the attached .imp.
The sample only has 5 text input boxes in a multi frame, but you could stack 10 or 20 or 50 or more, setting each to save the text entered to a separate variable. The multi frame can be advanced one frame at a time using a button, or you could conceivably set it to advance using other triggers independent of a button.

I'm not sure how the page would be set up, so I wasn't able to add scroll bars. However, these would not be difficult to add, if you had multi frames running past the page margin.

Take a look at the .imp file. I hope this helps.

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: January 26th, 2007, 11:16 pm 
Offline

Joined: January 23rd, 2006, 6:23 am
Posts: 23
Location: Hollywood
Thanks, Stephen, for taking the time to make "sample.imp" That will definitely work for a limited amount of Text Input Box additions. But I need the "add another box" button to be able to be clicked as many times as the user desires (ten thousand times, if needed) and each time adding a new text input box.

Your initial suggestion of using the CloneObject script command works for adding boxes.
I am now looking for a way to give each new cloned box a unique Text Input Variable.

Here's what I did so far:

1. I created a large frame and dragged the vertical scroll bar tool into the frame.

2. Inside the frame, I created a text input box 50 pixels tall and named it "box1" (this is the text box to be cloned). The text input is the variable "MyText001"

3. On Show, I created the variable "location1" with a value of 100. This variable will contain the vertical position of the new cloned box.

4. On Left Mouse Click of "box1" I am running the following script:

box1.CloneObject(200,location1.valueOf(),true) 
location1 = location1.valueOf() + 50

When I run the publication and click on box1, I get a clone of box1 at location (200, 100). When I click on box1 again, I get another clone at (200, 150), then (200,200), then (200,250), etc. with each new box located below the others, 50 pixels down.

When the additional boxes run off the bottom of the screen a scroll bar is automatically generated.

This is exactly what I want as far as box creation goes. But in between the two lines of script
I need to add a script that will change the name of the Text Input Variable of the Text Box (increment the name by 1)
so that the next clone will have a unique Text Input Varialbe name. But still allow the previous Variable to be used elsewhere on the page.


I would greatly appreciate any suggestions.


Top
 Profile  
 
 Post subject:
PostPosted: January 27th, 2007, 1:01 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I'm impressed with your progress so far!

I'm afraid my scripting skills are limited, especially in the area of incrementing. My guess, however, is that it can be done, maybe using a clone array, incrementing the variable for each clone using ++. This is where I get lost. Hopefully, a Forum colleague or DW support team member can comment and suggest specifically how.

I'll be interested in seeing what they suggest.

Sorry I can't be of more help.

Kind Regards,

_________________
Stephen


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 58 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