Flash Form Communication

  • Travis Coats
  • Graduate
  • Graduate
  • Travis Coats
  • Posts: 107

Post 3+ Months Ago

This one has been fun, here is my current code:

stop();

//this is the code that defines a variable named gatherForm which will take all the data in the fields and store them in itself

var DataSender:LoadVars = new LoadVars();
var DataReceiver:LoadVars = new LoadVars();
//code to set main variable with contained variables to bluehost

function sendForm() {
DataSender.sendtoemail = "travis@allinnia.com";
DataSender.enctype = "multipart/form-data";
DataSender.Name = form.userName.text;
DataSender.Email = form.userEmail.text;
DataSender.Message = form.userComment.text;
DataSender.Music = form.music.selectedData;
DataSender.Favorite_Track = form.cFavorite.selectedItem.label;
DataSender.sendAndLoad("http://www.allinnia.com/email.cfm",DataReceiver,"POST");
}

// function that validates form with if statement\\
this.form.submitBtn.onRelease = function() {
if (form.userName.text == "" || form.userComment.text == "" || form.music.selectedData == undefined) {
gotoAndStop("error");
} else {
sendForm();
DataSender.onLoad = function(success:Boolean) {

if (success) {

// if the server returns something

gotoAndStop("correct");

} else {

// the server never sent anything back

trace("server or connection error");

}
};
trace(form.userName.text);
trace(form.userEmail.text);
trace(form.userComment.text);
trace(form.music.selectedData);
trace(form.cFavorite.selectedItem.label);
gotoAndStop("correct");
}
};

My server uses a CGI named bluehost, and I was having problems with it sending mail all the time, I tested it repeatedly on my machine, and it would work sometimes but not always. So now I am trying to go through cold fusion mail document, and this is what I get in my output window on run.

"TRACED DATA"
Travis
travis@allinnia.com
This is not working
Positive
Other World
Error opening URL 'http://www.allinnia.com/email.cfm'

The .cfm is in the right directory, and here is what it looks like:
<cfmail>

to ="travis@allinnia.com"

from = "#Datasender.Email#"

subject = "Website Critique"

server = "mail.allinnia.com"

name : "#Datasender.Name#"

email : "#DataSender.Email#"

message :"#Datasender.Message#""#Datasender.Music#""#DataSender.Favorite_track#"

</cfmail>

I am new to Cold Fusion docs, but I am unable to find out why this problem is happening, does anyone out there have a correction or substitute for getting flash to mail form data(that works for you). This topic never seems to have one answer or format so I am eager to hear yours
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Travis Coats
  • Graduate
  • Graduate
  • Travis Coats
  • Posts: 107

Post 3+ Months Ago

forgot to mention some of the notes are from earlier working, i.e.gatherForm. This worked on my machine sometimes using sendAndLoad("http://www.bluehost.com/bluemail",DataReciever,"POST")

but it has never worked when I upload it to the main site.
  • Travis Coats
  • Graduate
  • Graduate
  • Travis Coats
  • Posts: 107

Post 3+ Months Ago

Come on guys, anybody? It really boils down to me asking someone who using a similar interface for their forms, and maybe getting some PHP script or some other alternative. This can't be that hard I see flash forms all over the place.

I did get some useful advice: Don't use a data receiver. so the new code reflects this.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

also there are plenty of send mail codes all over this forum.
  • Nucleo
  • SausagePorkPie
  • Mastermind
  • User avatar
  • Posts: 2297
  • Loc: UK - England

Post 3+ Months Ago

i did notice that
Quote:
function sendForm() {

DataSender.sendtoemail = "travis@allinnia.com";

DataSender.enctype = "multipart/form-data";

DataSender.Name = form.userName.text;

DataSender.Email = form.userEmail.text;

DataSender.Message = form.userComment.text;

DataSender.Music = form.music.selectedData;

DataSender.Favorite_Track = form.cFavorite.selectedItem.label;

DataSender.sendAndLoad("http://www.allinnia.com/email.cfm",DataReceiv er,"POST");

}


shouldn't that all be one word?

no idea about the CF doc.
  • wasanasl
  • Born
  • Born
  • wasanasl
  • Posts: 1
  • Loc: horana

Post 3+ Months Ago

thanx all

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 17 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.