Thursday, July 31, 2008

Flash - PHP Feedback Form

Flash - PHP Feedback Form. It is easy to create and send your comments with in few seconds..






Paste below codings in your flash action script file.


var sendData_lv:LoadVars = new LoadVars();
var receiveData_lv:LoadVars = new LoadVars();
var formValidated:Boolean;
var errorMessages:Array = new Array();

receiveData_lv.onLoad = function():Void{
trace(this.sent);
if(this.sent == "OK"){
message0_txt.text = "Thank you for your feedback";
}else{
message0_txt.text = this.sent;
}
}


submit_btn.onRelease = function() {
//this clears the error text field if they have been populate previously
clearTextFields();
errorMessages.length = 0; //empty the array so next time the submit button is clicked the array is not already populated
formValidated = checkForm();
if (formValidated) {
//the form is valid and so now we can send details to our PHP file
//populate LoadVars object with the field values
sendData_lv.name = name_txt.text;
sendData_lv.email = email_txt.text;
sendData_lv.feedback = feedback_txt.text;
//trace(sendData_lv.email);
//trace("valid");
sendData_lv.sendAndLoad("email.php?ck="+new Date().getTime(), receiveData_lv);
} else {
//populate textfields with the error messages
for (var i = 0; i _root["message"+i+"_txt"].text = errorMessages[i];
trace(errorMessages[i]);
}
}
};


function checkForm():Boolean {
//check whether the name field is empty
if (name_txt.text == "") {
errorMessages.push("Please enter your name.");
}
if (email_txt.text == "") {
errorMessages.push("Please enter your email address.");
} else if (email_txt.text.indexOf("@") == -1 || email_txt.text.indexOf(".") == -1) {
errorMessages.push("Please enter a valid email address.");
}
if (feedback_txt.text == "") {
errorMessages.push("Please enter some feedback");
}
//if at this point the array is empty i.e has length 0, then this in effect means the form has passed all checks
if (errorMessages.length == 0) {
return true;
} else {
return false;
}
}


function clearTextFields():Void {
for (var i = 0; i _root["message"+i+"_txt"].text = "";
;
}
}


Your Actionscript file is ready then create a phpl file to send your information. The php file names as email.php

$name = $_POST['name'];
$email = $_POST['email'];
$feedback = $_POST['feedback'];
$subject = 'feedback from your website';
$headers = "From: $name <$email>\n";
$headers .= "Reply-To: $name <$email>\n";

//ENTER YOUR EMAIL ADDRESS HERE
$to = 'innovativeidea@gmail.com';
//---------------------------

$success = mail($to, $subject, $feedback, $headers);
if($success){
echo '&sent=OK';
}else{
echo '&sent=Error';
}
?>


 






Wednesday, July 30, 2008

Web 2.0 Badges

Badges are a key requirement for any basic website too. Here is a set of very cool Web 2.0 Badges for you in .PSD and .PNG formats.





***********************************************

Tuesday, July 22, 2008

Get Flash Tips from Me

Hi Friends,
                You can get all tips & tricks using flash actionscript to make a animated screen on your website. If you are a novice then this tutorial will be easier to understand and make you a professional flash designer. Look More from me to get all the tutorials in actionscript

Tuesday, July 15, 2008

For Free Ajax,PHP,Mysql Codings

For free Ajax,php,mysql codings visit : mycodings.blogspot.com. Here you'll get all types of PHP,Ajax Codings & mysql queries .

Flash Slideshow With XML

Paste the below coding in a actionscript file

function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
description = [];
linkDetails = [];
total = xmlNode.childNodes.length;
i = 0;
while (i < text =" _root.linkDetails;" content = "no file loaded!" loaded ="=" _alpha =" 0;" text =" description[p];"> 0)
{
--p;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}

function firstImage()
{
if (loaded == filesize)
{
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
link.text = link[0];
picture_num();
}
}

function picture_num()
{
current_pos = p + 1;
pos_txt.text = current_pos + " / " + total;
}

_global.slideshow = "on";
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
//xmlData.load("images.php");
listen = new Object();
listen.onKeyDown = function ()
{
if (Key.getCode() == 37)
{
prevImage();
return;
}

if (Key.getCode() == 39)
{
nextImage();
}

}

Key.addListener(listen);
previous_btn.onRelease = function ()
{
prevImage();
}

next_btn.onRelease = function ()
{
nextImage();
}

p = 0;
this.onEnterFrame = function ()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded == filesize)
{
preloader._visible = false;
if (picture._alpha < _alpha =" picture._alpha" _xscale =" 100" slideshow ="=" now =" getTimer();"> flip)
{
if (p > total - 2)
{
p = 0;
flip = flip + 4000;
firstImage();
return;
}

flip = flip + 4000;
nextimage();
}

}
}

Your Actionscript file is ready then create a xml file with datas in the format given below :
<1?xml version="1.0" encoding="UTF-8">
<1images>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>

<1/images>
*Remove 1 in every html tag
For demo Check : Liveindiacuisine.com