PDA

View Full Version : Dynamic Form Trouble mx04


troyjack
05-04-2004, 06:39 PM
Hi
I'm trying to make a form in MX04 containing four comboBoxes. All I need is the selections from the comboBox to be displayed in another frame with a label ( Wall Color = Blue). Here's my code on the submit button so far:

on (release) {
var input = new LoadVars();
input.size = size.getValue();
input.wallColor = wallColor.getValue();
input.roofColor = roofColor.getValue();
input.trimColor = trimColor.getValue();

Now what do I do? I've tried many different things, but nothing works. I did something similar to this once before, but the results were sent to an email address instead of a dynamic text box within the same website and it worked fine. I used this code:

input.send("http://www.website.com/sendmail1.php", "_self", "GET");

I figured just changing this to target the dynamic text box would work, but it doesn't.
Can anyone please help me? I'm sure it's something simple that I'm not seeing.

Thank You
troy

troyjack
05-06-2004, 08:21 PM
ok. To make this question a little simpler (since it was a little confusing to begin with, and the code is completely different now), All I really need to know is how to display the results of a comboBox in a Dynamic text field in another layer?
I haven't been able to find anything online about it pertaining to MX2004 and I'm not a savvy coder. ANY reply would help and would be much appreciated

troyjack
05-06-2004, 08:29 PM
the dynamic text box is in a differnt FRAME. sorry

Rossman
05-06-2004, 09:03 PM
Another Keyframe in your Flash movie or another frame (or iframe) in an HTML page?

troyjack
05-07-2004, 04:15 PM
another keyframe in the Flash movie.....basically on the click of a submit button, the frame changes from frame 1 (containing the comboBoxes) to frame 4 (containing the dynamic text area to display the results).....I hope I'm being clear enough-I'm fairly new at this.....

troyjack
05-07-2004, 04:49 PM
Ok, I got it working.....for future reference, if anyone is trying to do the same thing, here's how it works:

on Frame containing 2 comboBoxes:

cB = new Object();
cB.change = function(evt){
dynamic_txt = "myComboBox1: "+myComboBox1.value+"\nmyComboBox2: "+myComboBox2.value;

}
myComboBox1.addEventListener("change", cB);
myComboBox2.addEventListener("change", cB);

THEN, on the Frame containing the Dynamic Text:

myResultText.text = dynamic_txt;

//note:::dynamic_txt is the VAR name of the Dynamic text box, and "myResultText" is the Instance Name.

Rossman
05-07-2004, 05:44 PM
Right, so why not, when the user clicks the submit button, save your combobox states to global variables and then when you get to frame 4 you just read those vars back and fill in your text box?

On Frame 1:
_global.WallColour = wallColor.getValue();
_global.RoofColour = roofColor.getValue();
etc.

Then on Frame 4:
textbox.text = "Wall Colour = " + _global.WallColour + "\r";
textbox.text += "Roof Colour = " + _global.RoofColour + "\r";

and so forth...
Kinda cheap but should work....probably is better ways of doing it...

Rossman
05-07-2004, 05:45 PM
Yeah, your way is probably better...sweet!

troyjack
05-07-2004, 06:23 PM
thanks for the suggestion though!