i’m creating a completely dynamic form. i want to assign a variable name to a textfield and then pass that variable with a LoadVars() object.
here’s a small piece of code i can’t get working:
//create movieclip (used like a form)
_root.createEmptyMovieClip( ‘dialog_body’, 0 );
//create textfield input
dialog_body.createTextField( answer, 50, 500, 150, 100, 30 );
dialog_body[ answer ].type = “input”;
dialog_body[ answer ].border = true;
dialog_body[ answer ].variable = “fname”; //id will be 1 - 400
// lname is a textfield created using the stage, and the properties window
// putting ‘lname’ as the var.
//when button is clicked
mybutton.setClickHandler( “OnClick” );
function OnClick() {
trace( dialog_body[ “fname” ] ); //traces the correct value
trace( lname ); //traces the correct value
dialog_body.removeMovieClip();
//simple test script prints all the recieved variables
getURL( 'testing.php', 0, 'post' );
}
problem / question: my test script ‘testing.php’ doesn’t have any knowledge of dialog_body[ “fname” ], why?
it prints:
FUIComponentClass=[type Function]
FPushButtonClass=[type Function]
OnClick=[type Function]
i=0
lname=smith
— where is fname?
bottomline: if i create a textfield using the traditional method and assign the ‘var’ it works fine. if i create a textfield dynamically at run time, and use the *.variable property, the variable is NOT sent…why? and how?
thanks for any (much needed) help.