rendered paste body<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:HTTPService id="emailService" url="email2.php" method="POST" resultFormat="xml" result="emailResult()" useProxy="false"/>
<mx:states>
<mx:State name="LoginError"/>
<mx:State name="help">
<mx:AddChild position="lastChild">
<mx:Panel x="402" y="32" width="295" height="292" id="helpanel" layout="absolute" title="Help">
<mx:TextArea x="0" y="0" width="275" height="252" wordWrap="false" editable="false" enabled="true">
<mx:text><![CDATA[This is pretty simple. You just fill out the seven
numbers in ORDER, then you simply guess or
if you know the word, you'll put it there. You should
insert a valid e-mail address so if you are the winner
then Hayk may easily e-mail you, and Give you your
prize:)
Any questions contact: info@hayasapictures.com ]]></mx:text>
</mx:TextArea>
<mx:Button x="211" y="220" label="Back" click="{currentState = 'Base state'}"/>
</mx:Panel>
</mx:AddChild>
<mx:SetStyle target="{loginBox}" name="horizontalCenter" value="-133"/>
<mx:SetStyle target="{loginBox}" name="verticalCenter" value="-1"/>
</mx:State>
</mx:states>
<mx:Canvas id="loginBox" creationCompleteEffect="fxTools" width="296" height="416" borderStyle="solid" borderThickness="0" backgroundColor="#fafafa" cornerRadius="5" borderColor="#90c4de" shadowDirection="right" shadowDistance="8" dropShadowColor="#000000" dropShadowEnabled="false" x="249" y="61">
<mx:Label x="10" y="54" text="#1"/>
<mx:TextInput x="38" y="52" id="number1" width="33" maxChars="2"/>
<mx:Label x="70" y="54" text="#2"/>
<mx:TextInput x="98" y="52" id="number2" displayAsPassword="false" width="34" maxChars="2"/>
<mx:Button x="220" y="384" label="Submit" id="submitBtn" click="this.sendEmail();">
</mx:Button>
<mx:HRule x="16" y="372" width="264" height="4"/>
<mx:HRule x="10" y="33" width="264" height="4"/>
<mx:Label x="20.5" y="10" text="Hayasa Pictures Contest #2" color="#557d90" fontSize="14" fontWeight="bold"/>
<mx:Label x="140" y="54" text="#3"/>
<mx:TextInput x="38" y="97" id="number4" displayAsPassword="false" width="33" maxChars="2"/>
<mx:TextInput x="168" y="52" id="number3" displayAsPassword="false" width="33" maxChars="2"/>
<mx:Label x="10" y="99" text="#4"/>
<mx:Label x="70" y="99" text="#5"/>
<mx:TextInput x="168" y="97" id="number6" displayAsPassword="false" width="33" maxChars="2"/>
<mx:TextInput x="98" y="97" id="number5" displayAsPassword="false" width="34" maxChars="2"/>
<mx:Label x="140" y="99" text="#6"/>
<mx:Label x="10" y="139" text="#7"/>
<mx:TextInput x="98" y="179" id="senderName"/>
<mx:Text x="10" y="181" text="Your Name:"/>
<mx:TextInput x="98" y="209" id="senderEmail"/>
<mx:Text x="10" y="211" text="Your E-Mail:"/>
<mx:Text x="10" y="241" text="Secret Word:"/>
<mx:TextInput x="98" y="239" id="word" editable="true" enabled="true" maxChars="8"/>
<mx:TextInput x="38" y="137" width="33" id="number7" maxChars="2"/>
<mx:Image x="209" y="45">
<mx:source>http://www.hayasapictures.com/forum/images/smilies/wink.gif</mx:source>
</mx:Image>
<mx:Text x="16" y="381" id="alert" width="196"/>
<mx:Image x="121.5" y="269" width="118" height="95">
<mx:source>http://bp2.blogger.com/_l2r3qfchchQ/R1XMig8tS1I/AAAAAAAAACU/nVc9aJQ3muM/s320/Hye+Wear+banner.jpg</mx:source>
</mx:Image>
<mx:Text x="20.5" y="287" text="Sponserder By:"/>
</mx:Canvas>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent
public function sendEmail( ):void
{
if (number1.text == "" || number2.text == "" || number3.text == "" || number4.text == "" || number5.text == "" || number6.text == "" || number7.text == "" || word.text == "" || senderName.text == "" || senderEmail.text == "" )
{
Alert.show("Error! You cannot leave fields blank.");
}
else
{
var senderName:String = senderName.text;
var senderEmail:String = senderEmail.text;
var emailMessage:String = number1.text || number2.text || number3.text || number4.text || number5.text || number6.text || number7.text || word.text;
this.emailService.send({senderName: senderName, senderEmail:senderEmail,emailMessage: emailMessage});
}
}
public function emailResult():void
{
Alert.show("Email Has Been Sent");
this.submitBtn.enabled = false;
}
]]>
</mx:Script>
</mx:Application>