MX button component > 2004 button component


okay, I’m moving from MX to MX2004 and I’m having trouble with MX2004 button component. I’m used to the change click handler function and I know for MX2004, I need to use a listener but I can’t get my code to work. Whats wrong? :upset: :sigh: :crazy: :huh: :frowning:

onSubmitListener = new Object(); = function();
//Create a new LoadVars instance for the form data
formData = new LoadVars();
//Initialize formData variables
formData.txtZip = “”;
formData.cboDist = “”; = “stores”;
//Gather the order information into a LoadVars Instance
formData.txtZip = escape(txtZip.text);
formData.cboDist = cboDist.getValue(); = “stores”;

//Create another LoadVars instance to receive the server's reply
replyData = new LoadVars();
//Initialize reply variable
replyData.reply_txtZip = "";
replyData.reply_cboDist = "";
replyData.reply_dealer = "stores";
//Specify a function to call when this new instance receives the reply
replyData.onLoad = handleReply;
//Submit the data
formData.sendAndLoad("", replyData, "POST");
//Telling the user what is happening
scroller.text = "Please wait while your information is being processed. . .";

onSubmit.addEventListener(“click”, onSubmitListener);

function handleReply(success) {
if (success) {
trace(“done loading”);
scroller.html = true;
scroller.htmlText = replyData.textfield;
} else {
scroller.text = “There was a problem submitting your information. The server my be down or not responding.”;