RE: flash-cf to save data

2004-03-25 Thread Robert Redpath
What is the output of:
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm;
save_game_o.sendAndLoad(composite,null,GET);

Is it something like this format?Can you type something like this URL into
your browser to get it to work?
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm?id=1
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm?id=1high_scor
e=150high_score_releated=whatever
high_score=150high_score_releated=whatever

 
Also have you tried to output the variables on your CF page to make sure
they are being seenbefore you do any processing? Like: 
cfoutput
#url.id##url.high_score##url.high_score_related_info# etc
/cfoutput

-Original Message-
From: Daniel Kessler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 12:58 PM
To: CF-Talk
Subject: flash-cf to save data

I'm trying to send data from Flash to Cold Fusion to have it entered 
in a DB.I can't get it to work.I'm experienced at flash but have 
not used loadVars before and am new to CF.

I have simplified the loadVars to a full url and a pretermined 
string, rather than building the string.The CF uses url.variable to 
get the info, so I'm passing it via the querystring.No matter what 
I do, it doesn't update on the DB.Here's the Flash code:

function sendData(save_string){

// Create a LoadVars object to hold the variables we wish to send
save_game_o = new LoadVars();
save_game_o.id = 1;
save_game_o.high_score=50;
save_game_o.high_score_related_info=bent|tennis_player;

save_game_o.saved_game=user{ljkh,11,3,B,m}score{0,1,1}vegetables}wo{}so{}so
{}hph{0};
save_game_o.load = function(success) {
if (success) {
 //doesn't show this//
 _level1.error.text = success:+success;
} else {
 _level1.error.text = error loading data;
}
};

var composite = 
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm;
save_game_o.sendAndLoad(composite,null,GET);

}

The CF is at:
http://www.phiresearch.umd.edu/bodyfun/main_game/save_game.cfm
I put it on a server that doesn't have CF just so that you can view 
the code.The flash uses a server that runs CF fine.

Also, I made a composite of the url and the querystring and it worked 
fine, updating all the info, so it seems to be a Flash to CF 
communication problem.

thanks for any help.

-- 
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD20742-2611
301-405-2545 Phone
www.phi.umd.edu 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: flash-cf to save data

2004-03-25 Thread Robert Redpath
In your CF page you are looking for URL variables: #url.id#, etc...

 
Have you tried plain 'ol variables: not #url.id# but #id#?

-Original Message-
From: Daniel Kessler [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 4:49 PM
To: CF-Talk
Subject: flash-cf to save data

What is the output of:
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm; 
save_game_o.sendAndLoad(composite,null,GET);

I don't know as it won't pop out a page to display the information if 
I use either loadVars (sendAndLoad) or LoadVariables.However if I 
do getURL, which pops out a page, I see the proper querystring and CF 
outputs the expected data.

At 4:42 PM -0500 3/25/04, Daniel Kessler wrote:
Is it something like this format?Can you type something like this URL
into
your browser to get it to work?
http://www.preventcancer.org/bodyfun/main_game/save_game.cfm?id=1high_scor
e=100

yes.

Also have you tried to output the variables on your CF page to make sure
they are being seenbefore you do any processing? Like:
cfoutput
#url.id##url.high_score##url.high_score_related_info# etc
/cfoutput

I have with getURL and it looked fine, but not with sendAndLoad 
because it suppresses (it seems to me) the page output or rather I 
get it's redirected, supposedly to the flash app.

I can get this to work with loadVariables, but not loadVars, which 
has sendAndLoad.The reason that I want sendAndLoad to work is that 
it's more flexible and I can track it's progress better.

Also to return variable data to Flash, do I do:
cfquery name=return_saved_game datasource=cs-site
SELECT * FROM bodyfun_save_game
WHERE identifier = #url.id#
/cfquery
cfoutput
saved_game=#return_saved_game.saved_game#
/cfoutput

Should I expect that'll return a variable saved_game to the flash app?

Wasn't much about this in the archives and the cf-flash list seemed 
lonely.Don'tya-all do alot of Flash too?

-- 
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD20742-2611
301-405-2545 Phone
www.phi.umd.edu 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]