Thanks to all, it is woking and posting all data. function doSubmitViaEnter(e:KeyboardEvent):void { if (e.keyCode == 13) { status_txt.text = "Posting nomination...\nPlease wait..."; doSubmit(); } }
function doSubmit(e:MouseEvent=null):void { var clip:MovieClip = active_clip.mc_form; if (fname1field.text == "" || lname1field.text == "" || email1field.text == "" || clip.fnamefield.text == "" || clip.lnamefield.text == "" || clip.titlefield.text == "" || clip.emailfield.text == "") { status_txt.text = "Please fill in all required fields."; } else { //All fields valid so send away! status_txt.text = "Posting nomination...\nPlease wait..."; doSend(); } } //Disable all the fields and buttons //prep all the variables that need to be sent to PHP //send them to register.php function doSend():void { for (var i:uint = 0; i < fields.length; i++) { fields[i].enabled = false; } //enable preloader dots dots.visible = true; dots.play(); var variables:URLVariables = new URLVariables(); // variables follow ..... On Dec 16, 2010, at 7:48 PM, Merrill, Jason wrote: > You shouldn't be manually calling an event handler in your code. If you want > multiple event handler functions to run the same set of code, then create a > third function that they all call. > > function onSomething(event:Event):void > { > doIt(); > } > > function onSomethingElse(event:Event) > { > doIt(); > } > > function doIt():void > { > //doStuff. > } > > > Jason Merrill > Instructional Technology Architect > Bank of America Global Learning > > > > > > _______________________ > > -----Original Message----- > From: flashcoders-boun...@chattyfig.figleaf.com > [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of DONALD TALCOTT > Sent: Thursday, December 16, 2010 7:24 PM > To: Flash Coders List > Subject: Re: [Flashcoders] error mesg > > I failed to mention, also have the following for a button; > mc_aim_higher.mc_form.submitBtn.addEventListener(MouseEvent.CLICK, doSubmit); > > If I remove "e.MouseEvent" the button won't work. > > > On Dec 16, 2010, at 7:05 PM, Nathan Mynarcik wrote: > >> Take out the "e:MouseEvent" in your doSubmit function. >> On Dec 16, 2010 6:40 PM, "DONALD TALCOTT" <dtalc...@mindspring.com> wrote: >>> I have the following code below. When I compile the swf,I get the >> following error; >>> Line 187 1136: Incorrect number of arguments. Expected 1. >>> >>> Have been playing with this all day, somewhat new to as3, and this >>> has me >> stumped. >>> Any help/insight would be greatly appreciated. >>> >>> >>> stage.addEventListener(KeyboardEvent.KEY_DOWN, doSubmitViaEnter); >>> >>> function doSubmitViaEnter(e:KeyboardEvent):void >>> { >>> if (e.keyCode == 13) >>> { >>> doSubmit(); // this is line 187 >>> } >>> }; >>> >>> >>> function doSubmit(e:MouseEvent):void >>> { >>> var clip:MovieClip = active_clip.mc_form; >>> >>> if (fname1field.text == "" || lname1field.text == "" || >>> email1field.text >> == "" || clip.fnamefield.text == "" || clip.lnamefield.text == "" || >> clip.titlefield.text == "" || clip.emailfield.text == "") >>> { >>> status_txt.text = "Please fill in all required fields."; } else { >>> //All fields valid so send away! >>> status_txt.text = "Posting nomination...\nPlease wait..."; doSend(); >>> } } >>> >>> >>> >>> >>> DON TALCOTT >>> 316 Greenwood Avenue >>> Decatur, Georgia 30030 >>> >>> 404.538.1642 >>> dtalc...@mindspring.com >> > > DON TALCOTT > 316 Greenwood Avenue > Decatur, Georgia 30030 > > 404.538.1642 > dtalc...@mindspring.com > > > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > ---------------------------------------------------------------------- > This message w/attachments (message) is intended solely for the use of the > intended recipient(s) and may contain information that is privileged, > confidential or proprietary. If you are not an intended recipient, please > notify the sender, and then please delete and destroy all copies and > attachments, and be advised that any review or dissemination of, or the > taking of any action in reliance on, the information contained in or attached > to this message is prohibited. > Unless specifically indicated, this message is not an offer to sell or a > solicitation of any investment products or other financial product or > service, an official confirmation of any transaction, or an official > statement of Sender. Subject to applicable law, Sender may intercept, > monitor, review and retain e-communications (EC) traveling through its > networks/systems and may produce any such EC to regulators, law enforcement, > in litigation and as required by law. > The laws of the country of each sender/recipient may impact the handling of > EC, and EC may be archived, supervised and produced in countries other than > the country in which you are located. This message cannot be guaranteed to be > secure or free of errors or viruses. > > References to "Sender" are references to any subsidiary of Bank of America > Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are > Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a > Condition to Any Banking Service or Activity * Are Not Insured by Any Federal > Government Agency. Attachments that are part of this EC may have additional > important disclosures and disclaimers, which you should read. This message is > subject to terms available at the following link: > http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you > consent to the foregoing. > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders DON TALCOTT 316 Greenwood Avenue Decatur, Georgia 30030 404.538.1642 dtalc...@mindspring.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders