Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing data to flash

New Here ,
May 16, 2008 May 16, 2008
I downloaded a flash login setup and have been trying to revise it to my specific needs.

I have the login function working in that when they enter a valid username and password, they are directed to the correct frame in flash.

What I want to do is for a specific field record from my Access database to be diplayed on that page. Let's say, I have a field called "PetName"

Right now, the coldfusion setup is set to give a thumbs up or down as far as access. Here is the code:


<cfsetting enablecfoutputonly="Yes">

<cfquery name="ClientLogin" datasource="DSN name setup here">
SELECT *
FROM Clients
WHERE Customer = '#form.usr#'
AND Secret = '#form.pw#'
</cfquery>

<cfoutput>
<cfif #ClientLogin.recordcount# is '1'>
&CFresponse1=ok&
<cfelseif #ClientLogin.recordcount# is '0'>
&CFresponse1=bad&
</cfif>
</cfoutput>


What would I need to add to this code for it to send the data from the field "PetName" along with the ok or bad response?

Also, from within flash, what code would I need to display that record? Something to this affect:

loadVariables("f22clientlogin.cfm", _root.form);
Name = _root.form.PetName;

This flash is setup so that on the root level, various movieclips are loaded throughout the process, hence the root level references.

Thanks,
Dave
TOPICS
Flash integration
765
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2008 May 22, 2008
hope this helps.

Cheers
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2008 May 27, 2008
Okay, I'm trying to incorporate your coding with my setup. (Instead of Petname, I changed it to "Portfolio"):

Here is how my flash is set up:

I have the root level that contains the movieclip "form" which contains the form input fields and submit, etc.
The username text field is called "usr"
The password text field is called "pw"

When you click the submit button in the form movieclip, it sends the variables to the coldfusion page and then loades a movieclip from the library called "accessMsg" into form, which plays while the coldfusion processing takes place.

Here is the code I have set up for the submit button:
on(release, keyPress "<Enter>")
{
if (usr eq"" or pw eq"") {
gotoAndStop(4);
} else {
var1 = usr;
var2 = pw;
loadVariablesNum ("f22clientlogin2.cfm", 0, "POST");
attachMovie("accessMsg", "accessMsg", 1);
accessMsg._x = -5;
accessMsg._y = 60;
}
}

Here is the code I have for the accessMsg movieclip:
function getCF(success){
if(_root.fromCF.reply == ok)
{
_parent.gotoAndStop(3);

this.removeMovieClip();
}
else if(_root.CFresponse1 == "bad")
{
attachMovie("invalidMsg","invalidMsg",1);
_parent.acess.invalidMsg._x = -5;
_parent.acess.invalidMsg._y = 60;
this.removeMovieClip();
}
}

With a sucessful login, it goes to frame 3 of the movieclip "form" which has the following code:
stop();
Port = _root.Portfolio;

In this frame is the textfield "Port" in which it should post the "Portfolio" data that it would have received from coldfusion.

I set up the coldfusion page coding verbatim from what you gave me.

When I hit the submit button, the movie clip "accessMsg" comes up, but I get an interval server error when it accesses the coldfusion page. It doesn't give me a specific error message as it is through flash.

Any ideas?

Thanks,
Dave
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2008 May 27, 2008
Just for reference, here is the coldfusion page with the Petname references changed to Portfolio:

<cfquery name="ClientLogin" datasource="markf22_accesscf_f22customers">
SELECT *
FROM Clients
WHERE Customer = '#form.usr#'
AND Secret = '#form.pw#'
</cfquery>

<cfif #ClientLogin.recordcount# is '1'>

<cfset returnFlash = "&Portfolio=#URLEncodedFormat(ClientLogin.Portfolio)#&reply=ok&abc=123">

<cfelseif #ClientLogin.recordcount# is '0'>

<cfset returnFlash = "&Portfolio=noclient&reply=bad&abc=123">

</cfif>

<cfsetting enablecfoutputonly="Yes">

<cfoutput>
#returnToFlash#
</cfoutput>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2008 May 27, 2008
LATEST
I ran a test for the coldfusion page by setting up an html form with the username and password fields sent to the coldfusion page. I got this error:

Variable RETURNTOFLASH is undefined.


The error occurred in D:\Hosting\markf22\f22clientlogin2.cfm: line 21
19 :
20 : <cfoutput>
21 : #returnToFlash#
22 : </cfoutput>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources