Hiya....i really need hepl asap with this one. K here we go...i have a game in flash but i want the user to enter their name and score and for these to be posted to a db thro coldfusion. the code i have in the swf is _global.myLoadVars_lv:LoadVars=newLoadVars(); //create variables to send myLoadVars.username=name_txt.text; myLoadVars.score=score_txt.text; //send to coldfusion myLoadVars.send("score.cfm", "_blank", "POST"); I've tried looking for coldfusion recieving code in books, sites, other projects i've done. i'm at my wits please help!
What exactly is the problem, does the page score.cfm not load? Is it that you don't know how to insert data in a db - help us out what's wrong?
i can post data to a database...however when i send the variables from flash i don't know to accept them to coldfusion. there's a receiving code i need and i'm not sure what it is.
in terms of on the flash side, you are doing what you need to do. Let us see what you have in score.cfm. You will need something similiar to: <cfif IsDefined("Form.score")> <!--- Carry out some procedure to make sure the data submitted is clean ---> <!--- Insert the data into the database ---> <cfquery datasource='yourdatasource' password='Password' username='username'> Insert into TableName(score, username) Values (#CleanedScore#, '#CleanedUserName#') </cfquery> </cfif>
i have the insert code however i've been told that because coldfusion and flash dont run together 'in harmony' i suppose, that my coldfusion file will need some recieving code to read the flash variables.
you know what datropics? i actually haven't. I think i'm just assuming it won't work as so many of my classmates are saying it wont work without it....il try it without and let you know yeah? Thanks!