PDA

View Full Version : Sending Flash Ford to ColdFusion


alez
10-19-2005, 01:17 PM
Hi,
Well, Ive been trying to tackle this problem for a long time and its getting frustrating. Im sure its something stupid, but cant work it out. Im trying to send variables from flash to a coldfusion document in order to save all the data in an Access database. Please, would be really nice if you can give some tips to a desperate :eek: CFM newbie

This is the code in Flash 8 :

var varsProfesional:LoadVars = new LoadVars();
var varsProfesional_respuesta:LoadVars = new LoadVars();
varsProfesional.onLoad = function(exito)
{
if (exito)
{
msg = "Variables enviadas " + this.respuestaCF;
}
else
{
//Mostrar mensaje de error en el campo de texto
msg = "Error!! :(";
}
};

function enviarVariablesProfesional() {
varsProfesional.usuario = usuario;
varsProfesional.nombre = nombre;
varsProfesional.cif = cif;
varsProfesional.clave = clave;
varsProfesional.telefono1 = telefono1;
varsProfesional.telefono2 = telefono2;
varsProfesional.email = email;
varsProfesional.web = web;

varsProfesional.sendAndLoad("cf/nuevaEmpresa.cfm", varsProfesional_respuesta, "POST");
}

And this is the code in the coldfusion document:

<cfsetting enablecfoutputonly="Yes">

<cfquery name="chekcUsr" datasource="sdes">
SELECT *
FROM tbEmpresas
WHERE cif = '#FORM.cif#'
</cfquery>

<cfif checkUsr.RecordCount NEQ 0>
<cfoutput>
&respuestaCF=notOK&
</cfoutput>
<cfelse>
<cfquery name="empresasQRY" datasource="sdes">
INSERT INTO tbEmpresas(usuario, nombre, cif, clave, telefono1, telefono2, email, web)
VALUES ( '#FORM.usuario#' , '#FORM.nombre#' , '#FORM.cif#' , '#FORM.clave#' , '#FORM.telefono1#' , '#FORM.telefono2#' , '#FORM.email#' , '#FORM.web#')
</cfquery>
<cfoutput>
&respuestaCF=OK&
</cfoutput>
</cfif>


Thank you all in advance for this great site!

alez
10-20-2005, 10:28 AM
Sorry for the typing mistake.. FORD = FORM , alhotugh i guess its pretty obvious.

Pleaase help meee! Im really in need at the moment, i need to start developing this databse for work and Im completelly stuck, Ive been trying all shorts of things and I cant work out what the problem is.

I always receive the reply ("respuestaCF=OK") in flash, even If I have another entry with the same cif number.... whats wrong?? I think the mistake its in the coldfusion bit but cant work it out, all seems fine to me..

thank you for the help,

alez

alez
10-20-2005, 12:12 PM
Byt he way Im using Coldfusion MX 7 and flash 8 Professional.

alez
10-20-2005, 05:38 PM
It seems for some reason I cant explain coldfusion is not receiving the variables from flash at all, and I cant see why... I have also tried with Flash MX 2004 and nothing... pufff.. Its really getting too tyring..

Anyone came across this problem already???