<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple flash AS3 contact form with field validation</title>
	<atom:link href="http://www.scotflash.co.uk/blog/?feed=rss2&#038;p=13" rel="self" type="application/rss+xml" />
	<link>http://www.scotflash.co.uk/blog/?p=13</link>
	<description>Paul Ferrie Glasgow Flash developer blog</description>
	<lastBuildDate>Thu, 26 Aug 2010 08:00:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: Michal (SVK)</title>
		<link>http://www.scotflash.co.uk/blog/?p=13&#038;cpage=3#comment-9583</link>
		<dc:creator>Michal (SVK)</dc:creator>
		<pubDate>Sat, 14 Aug 2010 14:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.scotflash.co.uk/blog/?p=13#comment-9583</guid>
		<description>I tried to implement form to the existing project. May be I did there some mystake. Actually I have a two projects.In the 1st project I  just put a link via button to the 2nd project.</description>
		<content:encoded><![CDATA[<p>I tried to implement form to the existing project. May be I did there some mystake. Actually I have a two projects.In the 1st project I  just put a link via button to the 2nd project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Ferrie</title>
		<link>http://www.scotflash.co.uk/blog/?p=13&#038;cpage=3#comment-9582</link>
		<dc:creator>Paul Ferrie</dc:creator>
		<pubDate>Sat, 14 Aug 2010 14:10:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.scotflash.co.uk/blog/?p=13#comment-9582</guid>
		<description>What was the problem with the contact form?</description>
		<content:encoded><![CDATA[<p>What was the problem with the contact form?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michal (SVK)</title>
		<link>http://www.scotflash.co.uk/blog/?p=13&#038;cpage=3#comment-9581</link>
		<dc:creator>Michal (SVK)</dc:creator>
		<pubDate>Sat, 14 Aug 2010 13:49:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.scotflash.co.uk/blog/?p=13#comment-9581</guid>
		<description>I&#039;ve solved  the problem. Thx a lot for your interest.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve solved  the problem. Thx a lot for your interest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Ferrie</title>
		<link>http://www.scotflash.co.uk/blog/?p=13&#038;cpage=3#comment-9566</link>
		<dc:creator>Paul Ferrie</dc:creator>
		<pubDate>Sat, 14 Aug 2010 07:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.scotflash.co.uk/blog/?p=13#comment-9566</guid>
		<description>ok it might be easier if you just send me the fla and php script.</description>
		<content:encoded><![CDATA[<p>ok it might be easier if you just send me the fla and php script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michal (SVK)</title>
		<link>http://www.scotflash.co.uk/blog/?p=13&#038;cpage=3#comment-9565</link>
		<dc:creator>Michal (SVK)</dc:creator>
		<pubDate>Sat, 14 Aug 2010 07:19:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.scotflash.co.uk/blog/?p=13#comment-9565</guid>
		<description>Hi, here is the code and the php :

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset238{\*\fname Arial;}Arial CE;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang1051\f0\fs20 //---------------Setup variables\par
var loader:URLLoader = new URLLoader();\par
var req:URLRequest = new URLRequest(&quot;contact.php&quot;);\par
var variables:URLVariables = new URLVariables();\par
loader.dataFormat = URLLoaderDataFormat.VARIABLES;\par
req.method = URLRequestMethod.POST;\par
var gender:String=&quot;&quot;;\par
var senderRpl:String=&quot;No&quot;;\par
//--------------Set tab index\par
txName.tabIndex = 0;\par
txEmail.tabIndex = 1;\par
txSize.tabIndex = 2;\par
txPocet.tabIndex = 3;\par
txMessage.tabIndex = 4;\par
//--------------Set listener fot textfield changes\par
txName.addEventListener(Event.CHANGE, txErrorCheck);\par
txEmail.addEventListener(Event.CHANGE, txErrorCheck);\par
txSize.addEventListener(Event.CHANGE, txErrorCheck);\par
txPocet.addEventListener(Event.CHANGE, txErrorCheck);\par
txMessage.addEventListener(Event.CHANGE, txErrorCheck);\par
function txErrorCheck(event:Event):void \{\par
\tab if (txError.text.length&gt;0) \{\par
\tab\tab txError.text = &quot;&quot;;\par
\tab\}\par
\}\par
//--------------Set checkbox\par
cb.addEventListener(MouseEvent.CLICK,setReply);\par
function setReply(event:Event):void \{\par
\tab senderRpl=&quot;Yes&quot;;\par
\}\par
//--------------Set radio buttons for gender\par
rad1.addEventListener(MouseEvent.CLICK, changeHandler);\par
rad2.addEventListener(MouseEvent.CLICK, changeHandler);\par
function changeHandler(event:Event):void \{\par
\tab gender=event.currentTarget.label;\par
\}\par
//--------------Set up form buttons\par
butSend.addEventListener(MouseEvent.CLICK, sendForm);\par
butSend.txTitle.text=&quot;OBJEDNAT&quot;;\par
butReset.addEventListener(MouseEvent.CLICK, resetForm);\par
butReset.txTitle.text=&quot;RESET&quot;;\par
//--------------Validate fields and submit form\par
function sendForm(evt:MouseEvent):void \{\par
\tab if (txName.text.length&lt;=0) \{\par
\tab\tab txError.text = &quot;** Chyba meno **&quot;;\par
\tab\} else if (!txEmail.text.length &#124;&#124; txEmail.text.indexOf(&quot;@&quot;) == -1 &#124;&#124; txEmail.text.indexOf(&quot;.&quot;) == -1) \{\par
\tab\tab txError.text = &quot;missing field/Invalid email&quot;;\par
\tab\} else if (txSize.text==&quot;&quot;&#124;&#124;txSize.text.length&lt;=1) \{\par
\tab\tab txError.text = &quot;** Chyba velkost **&quot;;\par
\tab\} else if (txPocet.text==&quot;&quot;&#124;&#124;txPocet.text.length&lt;=1) \{\par
\tab\tab txError.text = &quot;** Chyba pocet **&quot;;\par
\tab\} else if (txMessage.text==&quot;&quot;&#124;&#124;txMessage.text.length&lt;=1) \{\par
\tab\tab txError.text = &quot;** Chyba adresa **&quot;;\par
\tab\} else if (gender==&quot;&quot;) \{\par
\tab\tab txError.text = &quot;** Prosim oznacte product **&quot;;\par
\tab\} else \{\par
\tab\tab mcLoader.gotoAndPlay(2);\par
\tab\tab variables.senderName = txName.text;\par
\tab\tab variables.senderEmail = txEmail.text;\par
\tab\tab variables.senderSize = txSize.text;\par
\tab\tab variables.senderPocet = txPocet.text;\par
\tab\tab variables.senderMsg = txMessage.text;\par
\tab\tab variables.senderSex = gender;\par
\tab\tab variables.senderRpl = senderRpl;\par
\tab\tab req.data = variables;\par
\tab\tab loader.load(req);\par
\tab\tab loader.addEventListener(Event.COMPLETE, receiveLoad);\par
\tab\}\par
\}\par
function receiveLoad(evt:Event):void \{\par
\tab if (evt.target.data.retval == 1) \{\par
\tab\tab mcLoader.gotoAndStop(25);\par
\tab\} else \{\par
\tab\tab mcLoader.gotoAndStop(1);\par
\tab\tab txError.text=&quot;**  ERROR SENDING MAIL **&quot;;\par
\tab\}\par
\}\par
//--------------Reset form\par
function resetForm(evt:MouseEvent):void \{\par
\tab txName.text=&quot;&quot;;\par
\tab txEmail.text=&quot;&quot;;\par
\tab txSize.text=&quot;&quot;;\par
\tab txPocet.text=&quot;&quot;;\par
\tab txMessage.text=&quot;&quot;;\par
\tab cb.selected=false;\par
\}\par
stop();\par
}
 
and PHP :

&lt;?php
$headers  = &quot;MIME-Version: 1.0\r\n&quot;; 
$headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;
if(empty($_POST[&#039;senderEmail&#039;])){
	echo&quot;no email address found&quot;;
	exit;
}
$senderName		= $_POST[&#039;senderName&#039;];
$senderEmail	= $_POST[&#039;senderEmail&#039;];
$senderMsg		= nl2br($_POST[&#039;senderMsg&#039;]);
$senderSize       = $_POST[&#039;senderSize&#039;];
$senderPocet      = $_POST[&#039;senderPocet&#039;];
$senderSex		= $_POST[&#039;senderSex&#039;];
$senderRpl		= $_POST[&#039;senderRpl&#039;];
$sitename		= &quot;www.nanakupe.sk&quot;;
$to 			= &quot;obchod@nanakupe.sk&quot;;
$ToName 		= &quot;info&quot;;
$date 			= date(&quot;m/d/Y H:i:s&quot;);
$ToSubject 		= &quot;Objednavka od $senderName z $sitename&quot;;
$comments 		= $msgPost;
$EmailBody 		= &quot;A visitor to $sitename has left the following information
              	Objednavka: $senderName
			 	
                        Produkt: $senderSex
				Velkost: $senderSize
				Kusov:   $senderPocet				
                        Adresa:
			  	$senderMsg&quot;;  
$EmailFooter	= &quot;Sent: $date&quot;;
$Message 		= $EmailBody.$EmailFooter;
$ok = mail($to, $ToSubject, $Message, $headers . &quot;From:$senderName &quot;);
if($ok){
	echo &quot;retval=1&quot;;
}else{
	echo &quot;retval=0&quot;;
}

thanks a lot.</description>
		<content:encoded><![CDATA[<p>Hi, here is the code and the php :</p>
<p>{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset238{\*\fname Arial;}Arial CE;}}<br />
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang1051\f0\fs20 //&#8212;&#8212;&#8212;&#8212;&#8212;Setup variables\par<br />
var loader:URLLoader = new URLLoader();\par<br />
var req:URLRequest = new URLRequest(&#8220;contact.php&#8221;);\par<br />
var variables:URLVariables = new URLVariables();\par<br />
loader.dataFormat = URLLoaderDataFormat.VARIABLES;\par<br />
req.method = URLRequestMethod.POST;\par<br />
var gender:String=&#8221;";\par<br />
var senderRpl:String=&#8221;No&#8221;;\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Set tab index\par<br />
txName.tabIndex = 0;\par<br />
txEmail.tabIndex = 1;\par<br />
txSize.tabIndex = 2;\par<br />
txPocet.tabIndex = 3;\par<br />
txMessage.tabIndex = 4;\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Set listener fot textfield changes\par<br />
txName.addEventListener(Event.CHANGE, txErrorCheck);\par<br />
txEmail.addEventListener(Event.CHANGE, txErrorCheck);\par<br />
txSize.addEventListener(Event.CHANGE, txErrorCheck);\par<br />
txPocet.addEventListener(Event.CHANGE, txErrorCheck);\par<br />
txMessage.addEventListener(Event.CHANGE, txErrorCheck);\par<br />
function txErrorCheck(event:Event):void \{\par<br />
\tab if (txError.text.length&gt;0) \{\par<br />
\tab\tab txError.text = &#8220;&#8221;;\par<br />
\tab\}\par<br />
\}\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Set checkbox\par<br />
cb.addEventListener(MouseEvent.CLICK,setReply);\par<br />
function setReply(event:Event):void \{\par<br />
\tab senderRpl=&#8221;Yes&#8221;;\par<br />
\}\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Set radio buttons for gender\par<br />
rad1.addEventListener(MouseEvent.CLICK, changeHandler);\par<br />
rad2.addEventListener(MouseEvent.CLICK, changeHandler);\par<br />
function changeHandler(event:Event):void \{\par<br />
\tab gender=event.currentTarget.label;\par<br />
\}\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Set up form buttons\par<br />
butSend.addEventListener(MouseEvent.CLICK, sendForm);\par<br />
butSend.txTitle.text=&#8221;OBJEDNAT&#8221;;\par<br />
butReset.addEventListener(MouseEvent.CLICK, resetForm);\par<br />
butReset.txTitle.text=&#8221;RESET&#8221;;\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Validate fields and submit form\par<br />
function sendForm(evt:MouseEvent):void \{\par<br />
\tab if (txName.text.length&lt;=0) \{\par<br />
\tab\tab txError.text = &quot;** Chyba meno **&quot;;\par<br />
\tab\} else if (!txEmail.text.length || txEmail.text.indexOf(&quot;@&quot;) == -1 || txEmail.text.indexOf(&quot;.&quot;) == -1) \{\par<br />
\tab\tab txError.text = &quot;missing field/Invalid email&quot;;\par<br />
\tab\} else if (txSize.text==&quot;&quot;||txSize.text.length&lt;=1) \{\par<br />
\tab\tab txError.text = &quot;** Chyba velkost **&quot;;\par<br />
\tab\} else if (txPocet.text==&quot;&quot;||txPocet.text.length&lt;=1) \{\par<br />
\tab\tab txError.text = &quot;** Chyba pocet **&quot;;\par<br />
\tab\} else if (txMessage.text==&quot;&quot;||txMessage.text.length&lt;=1) \{\par<br />
\tab\tab txError.text = &quot;** Chyba adresa **&quot;;\par<br />
\tab\} else if (gender==&quot;&quot;) \{\par<br />
\tab\tab txError.text = &quot;** Prosim oznacte product **&quot;;\par<br />
\tab\} else \{\par<br />
\tab\tab mcLoader.gotoAndPlay(2);\par<br />
\tab\tab variables.senderName = txName.text;\par<br />
\tab\tab variables.senderEmail = txEmail.text;\par<br />
\tab\tab variables.senderSize = txSize.text;\par<br />
\tab\tab variables.senderPocet = txPocet.text;\par<br />
\tab\tab variables.senderMsg = txMessage.text;\par<br />
\tab\tab variables.senderSex = gender;\par<br />
\tab\tab variables.senderRpl = senderRpl;\par<br />
\tab\tab req.data = variables;\par<br />
\tab\tab loader.load(req);\par<br />
\tab\tab loader.addEventListener(Event.COMPLETE, receiveLoad);\par<br />
\tab\}\par<br />
\}\par<br />
function receiveLoad(evt:Event):void \{\par<br />
\tab if (evt.target.data.retval == 1) \{\par<br />
\tab\tab mcLoader.gotoAndStop(25);\par<br />
\tab\} else \{\par<br />
\tab\tab mcLoader.gotoAndStop(1);\par<br />
\tab\tab txError.text=&quot;**  ERROR SENDING MAIL **&quot;;\par<br />
\tab\}\par<br />
\}\par<br />
//&#8212;&#8212;&#8212;&#8212;&#8211;Reset form\par<br />
function resetForm(evt:MouseEvent):void \{\par<br />
\tab txName.text=&quot;&quot;;\par<br />
\tab txEmail.text=&quot;&quot;;\par<br />
\tab txSize.text=&quot;&quot;;\par<br />
\tab txPocet.text=&quot;&quot;;\par<br />
\tab txMessage.text=&quot;&quot;;\par<br />
\tab cb.selected=false;\par<br />
\}\par<br />
stop();\par<br />
}</p>
<p>and PHP :</p>
<p>&lt;?php<br />
$headers  = &quot;MIME-Version: 1.0\r\n&quot;;<br />
$headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;<br />
if(empty($_POST[&#039;senderEmail&#039;])){<br />
	echo&quot;no email address found&quot;;<br />
	exit;<br />
}<br />
$senderName		= $_POST[&#039;senderName&#039;];<br />
$senderEmail	= $_POST[&#039;senderEmail&#039;];<br />
$senderMsg		= nl2br($_POST[&#039;senderMsg&#039;]);<br />
$senderSize       = $_POST[&#039;senderSize&#039;];<br />
$senderPocet      = $_POST[&#039;senderPocet&#039;];<br />
$senderSex		= $_POST[&#039;senderSex&#039;];<br />
$senderRpl		= $_POST[&#039;senderRpl&#039;];<br />
$sitename		= &quot;www.nanakupe.sk&quot;;<br />
$to 			= &quot;obchod@nanakupe.sk&quot;;<br />
$ToName 		= &quot;info&quot;;<br />
$date 			= date(&quot;m/d/Y H:i:s&quot;);<br />
$ToSubject 		= &quot;Objednavka od $senderName z $sitename&quot;;<br />
$comments 		= $msgPost;<br />
$EmailBody 		= &quot;A visitor to $sitename has left the following information<br />
              	Objednavka: $senderName</p>
<p>                        Produkt: $senderSex<br />
				Velkost: $senderSize<br />
				Kusov:   $senderPocet<br />
                        Adresa:<br />
			  	$senderMsg&#8221;;<br />
$EmailFooter	= &#8220;Sent: $date&#8221;;<br />
$Message 		= $EmailBody.$EmailFooter;<br />
$ok = mail($to, $ToSubject, $Message, $headers . &#8220;From:$senderName &#8220;);<br />
if($ok){<br />
	echo &#8220;retval=1&#8243;;<br />
}else{<br />
	echo &#8220;retval=0&#8243;;<br />
}</p>
<p>thanks a lot.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
