ID:154128
 
I already know about Lummox JR's article, "Whats Good Is The Browser?" But I'm looking for anything else someone has worked on. Or maybe what I should be check in the reference page?

What I basically need to do is when a button is clicked it resets or changes a some of the variables in DM. When you click the other button it locks those variables in and continues on its way. Also I'm hoping to make this a popup window.

Any ideas or code out there anyone can recommend?

LJR

What I basically need to do is when a button is clicked it resets or changes a some of the variables in DM. When you click the other button it locks those variables in and continues on its way. Also I'm hoping to make this a popup window.

Just make a normal website (converted into a popup window with a few additional arguments in browse()) with image links that refer to specific things in Topic(). I'm not especially familiar with Topic() myself, so I'll let someone more experienced explain that if you want.
LordJR wrote:
What I basically need to do is when a button is clicked
it resets or changes a some of the variables in DM. When
you click the other button it locks those variables in
and continues on its way. Also I'm hoping to make this a
popup window.

Since I'm not 100% sure what you're asking for here, let me first direct you to HTMLLib...

http://www.byond.com/hub/ hub.cgi?qd=hubIndex;hub=72;channel=1182

Next, I'd recommend that you school yourself as much as possible in HTML and JavaScript.

Finally, some code tips...

As Foomer suggested, for each HTML form that you want to process in DM, you're going to need to make use of the Topic proc (specifically, the one in the client object).

Say you have a form that you call, "LordJRTestForm". You could create some HTML like this...

<SCRIPT LANGUAGE="JavaScript1.2">
function doSubmit(action) {
LordJRTestForm.WhatToDo = action
LordJRTestForm.submit()
}
</SCRIPT>

<FORM NAME="LordJRTestForm" METHOD="POST" ACTION="">

<INPUT NAME="Foo" TYPE="TEXT">

<INPUT NAME="WhatToDo" TYPE="HIDDEN" VALUE="">

</FORM>

<a href="javascript:doSubmit('changeVars')">Change Vars</a>
<a href="javascript:doSubmit('lockInVars')">Lock-In Vars</a>


... and then have a client.Topic() proc that looks like this..

//somewhere else in your code you have this variable that
//you want to change

var/aDMVarNamedFoo

Topic(href,href_list[],hsrc)
switch(href_list["WhatToDo"])
if ("changeVars")

aDMVarNamedFoo = href_list["Foo"]

//Now send the user back to the same HTML page they
//submitted from by way of the "browse()" proc

if ("lockInVars")

//Do whatever constitutes "locking in" a var

//Now send the user to some other HTML page by way
//of the "browse()" proc


Is this along the lines of what you were looking for?

Regards,
Corporate Dog
In response to Corporate Dog
CDOG.. it answers a few of my questions.

And basically all I'm looking for is not something to be entered as the numbers will all be generated randomly first. The Form will most likely just be a graphically display of what the numbers rolled came out to be. Say you have 6 var. I think here I need to make a proc, and generate 6 random numbers. There her is where I'm not sure how to grab that info?

Display those numbers in 6 text boxes without really needing to reload the page. If you don't like the result of the numbers generated, click a button that calls the process to generate 6 new random numbers. Once you see something you like, it closes out the popup browser, and moves on with the game.

I have a good understanding of HTML, somewhat understand of Javascript, not to sure how to update text boxes without refreshing the whole page though.

Thanks for any suggestions..
LJR
In response to LordJR
I have a good understanding of HTML, somewhat understand of Javascript, not to sure how to update text boxes without refreshing the whole page though.

If you ever find out, let me know. =P
In response to LordJR
It's a long shop, but you can try a trick I was messing with in a recent project. Iframes.

Setup a table as your website popup, then for each square where you want a number to be, put an iframe that links to a page respresenting that number.

As a side note, you need a browse the file as a file, not actually show it, to preload it for use in frames.

Using iframes, you don't actually update the page every time something changes, you just update the frame containing the number.

In response to LordJR
LordJR,

Now THAT clears up quite a few things for me.

Again, Javascript is your friend. Try this on for size...

<SCRIPT LANGUAGE="JavaScript1.2">
function doRandomization()
//Sets the text field values to a random number
//between 1 and 6
LordJRRandomForm.Field1.value = Math.round(5*Math.random())+1;
LordJRRandomForm.Field2.value = Math.round(5*Math.random())+1;
LordJRRandomForm.Field3.value = Math.round(5*Math.random())+1;
return true;
</SCRIPT>

<FORM NAME="LordJRRandomForm" METHOD="POST" ACTION="">
<INPUT TYPE="TEXT" NAME="Field1" disabled><P>
<INPUT TYPE="TEXT" NAME="Field2" disabled><P>
<INPUT TYPE="TEXT" NAME="Field3" disabled>
<INPUT TYPE="HIDDEN" NAME="WhatToDo" VALUE="ProcessRandomNums">
<INPUT TYPE="BUTTON" VALUE="Randomize" onClick="doRandomization()">
<INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>


And then like I showed you in the last message, your DM code will use the Topic() proc of client to grab the values from the fields, when WhatToDo = ProcessRandomNums.

For extra credit, you might want to have the 'onLoad' event of your HTML Body tag run doRandomization() to initialize the values

Did I get it this time?

Regards,
Corporate Dog