Hi Everyone.
I have just started learning flash and php about a week ago, and am hoping you guys can help me find out what is wrong.
I have created a formmail feature form my flash movie and have a compiling problems.
My as3 code is as follows
[COLOR=seagreen]stop();[/COLOR]
[COLOR=seagreen]frmsend.addEventListener(“mouseDown”, sendData);[/COLOR]
[COLOR=seagreen]function sendData(evt:Event) {[/COLOR]
[COLOR=seagreen]if (frmfname.text!=""&&frmlname.text!=""&&frmemail.text!=""&&frmmessage.text!="") {[/COLOR]
[COLOR=seagreen]var myData:URLRequest=new URLRequest(“save.php”);[/COLOR]
[COLOR=seagreen]myData.method=URLRequestMethod.POST;[/COLOR]
[COLOR=seagreen]var variables:URLVariables = new URLVariables();[/COLOR]
[COLOR=seagreen]variables.frmfname=frmfname.text;[/COLOR]
[COLOR=seagreen]variables.frmlname=frmlname.text;[/COLOR]
[COLOR=seagreen]variables.frmemail=frmemail.text;[/COLOR]
[COLOR=seagreen]variables.frmmessage=frmmessage.text;[/COLOR]
[COLOR=seagreen]myData.data=variables;[/COLOR]
[COLOR=seagreen]var loader:URLLoader = new URLLoader();[/COLOR]
[COLOR=seagreen]loader.dataFormat=URLLoaderDataFormat.VARIABLES;[/COLOR]
[COLOR=seagreen]loader.addEventListener(Event.COMPLETE, dataOnLoad);[/COLOR]
[COLOR=seagreen]loader.load(myData);[/COLOR]
[COLOR=seagreen]} else {[/COLOR]
[COLOR=seagreen]status_txt.text=“All fields are mandatory”;[/COLOR]
[COLOR=seagreen]}[/COLOR]
[COLOR=seagreen]}[/COLOR]
[COLOR=seagreen]function dataOnLoad(evt:Event) {[/COLOR]
[COLOR=seagreen]if (evt.target.data.writing==“Ok”) {[/COLOR]
[COLOR=seagreen]gotoAndStop(2);[/COLOR]
[COLOR=seagreen]} else {[/COLOR]
[COLOR=seagreen]status_txt.text=“Error in saving submitted data”;[/COLOR]
[COLOR=seagreen]}[/COLOR]
[COLOR=seagreen]}[/COLOR]
[COLOR=seagreen]myData.sendAndLoad(“save.php”,myData,“POST”);[/COLOR]
[COLOR=seagreen][COLOR=black]My PHP Code is as follows[/COLOR][/COLOR]
[COLOR=seagreen]<?PHP [/COLOR]
[COLOR=seagreen]$to = “myemail@myemail.co.za[/COLOR][COLOR=seagreen]”; [/COLOR]
[COLOR=seagreen]$msg = "$frmfname
"; [/COLOR]
[COLOR=seagreen]$msg .= "$frmlname
"; [/COLOR]
[COLOR=seagreen]$msg .= "$frmemail
"; [/COLOR]
[COLOR=seagreen]$msg .= "$frmmessage
";[/COLOR]
[COLOR=seagreen]$email .= “myemail@myemail.co.za”[/COLOR]
[COLOR=seagreen]mail($to, $subject, $msg, From: ethekwinshade
Reply-To: $email
); [/COLOR]
[COLOR=seagreen]?> [/COLOR]
[COLOR=black]The error I am recieving in flash is as follows[/COLOR]
Flash CS4 sayas that the is a problem with the below line of code.
[COLOR=seagreen]myData.sendAndLoad(“save.php”,myData,“POST”);[/COLOR]
[COLOR=seagreen][COLOR=#000000]I thank you in advance for all the help:garfield:[/COLOR]
[/COLOR]