all groups > flash data integration > october 2005 >
You're in the

flash data integration

group:

Flash Form to Coldfusion Component to MySQL



Flash Form to Coldfusion Component to MySQL modernkaos
10/19/2005 4:40:03 PM
flash data integration: hello,

could someone please help me with an issue i'm having....

i'm trying to pass data from flash form fields into my coldfusion component
using a insert into (mysql statement)...

but i can't add any data to my database....

<cfcomponent>
<cffunction name="InsertData" access="remote" returntype="string">

<cfquery datasource="mysql2" name="InsertData">
INSERT INTO newtable2 (NAME_USER, NAME_EMAIL)
VALUES ("#name#", "#email#")
</cfquery>
<cfreturn InsertData>
</cffunction>
</cfcomponent>

and i'm getting the following error...

Variable name is undefined.

my UI Input text field are names: "name" & "email"...
i've done all the bindings correctly..(from webservice to input field)
i've set a WSDL URL and operation name

i've added the getURL to my submit button that goes to a CFM
page with the following code...

<cfinvoke webservice="someURL.cfc?wsdl" method="InsertData"
component="mysql.myCFC" returnvariable="InsertData"></cfinvoke>

Am i doing something wrong ?

and that should input the data into the database but it's not...

could someone PLEASE help me with this Data Integration issue...

i just can't figure out why the data won't pass....

***OR***

Help me (or point in the right direction) how i can do all this in Flash8...

All i'm really trying to do is pass the data from a form in Flash to MySQL
database....

I need this to work for a project so any help in the right direction with be
great :)

thank you for all your help in advance

greg carron
flash programmer
greg@kingweb.com
Re: Flash Form to Coldfusion Component to MySQL meager
10/20/2005 12:00:00 AM
Your CFC doesn't give a flip about what your form field names are from within
flash. This particual CFC is set up so that you are passing in positional
parameters. I get the feeling you are actually passing the flash textfield
object instead of the actual value.

When you make your call you need to pass it something like this.
yourService.cfcComponent(name.text, email.text)

Please show the actionscript you are using to make your call to the cfc if you
don't mind.

Mike
Re: Flash Form to Coldfusion Component to MySQL TheTaxman
10/20/2005 12:00:00 AM
mike,

this is all new to me so thank you for your help....

my mistake might be that i'm calling the invoke.cfm.....which has the cfinvoke
tag with
my CFC in the string....i'm not sure what the code should be on my flash
submit button....

but here's my actionscript on the submit button in flash...

on (click) {

//Goto Webpage Behavior
getURL("http://www.someURL.com/invoke.cfm","_self");
//End Behavior
// Trigger Data Source Behavior
// Macromedia 2003
this._parent.wsc.trigger();
}

is this correct ?

what should be the correct actionscript i'd need on the button ?

like u mentioned in your last post ?
..........http://www.somehting.com/url/testing.cfc?wsdl.testing(name.text,
email.text)

if my CFC is called "testing"
is this correct ?

thx man

greg
Re: Flash Form to Coldfusion Component to MySQL meager
10/20/2005 12:06:06 PM
Try this:

<cfcomponent>
<cffunction name="InsertData" access="remote" returntype="boolean">
<cfargument name="Name" required="Yes" type="string">
<cfargument name="Email" required="Yes" type="string">
<cfquery datasource="mysql2" name="InsertData">
INSERT INTO newtable2 (NAME_USER, NAME_EMAIL)
VALUES ("#name#", "#email#")
</cfquery>
<cfreturn true>
</cffunction>
</cfcomponent>

In this case I am as simply returning a boolean value from the CFC. It looks
like you were trying to return the actual function, which you can't do. But you
can return basically anything else (strings, structs, queries..etc.)

Re: Flash Form to Coldfusion Component to MySQL TheTaxman
10/20/2005 1:09:37 PM
meager...

first off i would like to thank you for your help
it is appreciated....

i've changed my code with your suggestions and
i am getting somewhere (hopefully closer to my goal)

i'm still getting an error....

The parameter NAME to function InsertData is required but was not passed in.

Why wouldn't the parameter get passed...
my form field names are correct

and i noticed that the params have been updated in the function under my
webservices in flash

i'm almost there....!.....lol

thx man

greg



Re: Flash Form to Coldfusion Component to MySQL FuseFlash
11/11/2005 12:57:32 PM
Have you solved this problem yet?
If no, let us know which version of Flash you are using.. Falsh and CF are
built to do this with the URL method you are reffering to....
This is NOT somethng you will be wanting to do with Actionscript, Set a path
to your CFC with a Webservice connector or remoting connector. You'll have more
joy...
If you need help, come back here.

AddThis Social Bookmark Button