I am trying to get a Flash form to send variables to a Cold Fusion template (.cfm page) to do the backend stuff (sending emails based on variable info, etc)
It seems Cold Fusion tips and topics are very scarce, so if anyone has any helpful information that would be great.
Flash and ColdFusion
I've had a lot of success with flash and coldfusion.
what do you need to know???
when submitting to the CF template (which would have the CFMAIL tag) from the Flahs movie, do you need to name the variables in the CF template as #URL.VariableName#? I guess the main question was how do the variables get passed to the page - as a string on the end of the URL, or FORM. or something?
Any tips would be most appreciated.
Flash and CF
You don't need to refer to them as #URL.Variable# - Just make sure you have them between <cfoutput></cfoutput> tags.
For example, i use the following template to get variables into flash using the load variables command:
<cfquery name="get_results" datasource="smartsettest" dbtype="ODBC" username="xxx" password="xxxx">
WHERE question LIKE '#question#'
<cfset total_votes = #Evaluate(value1 + value2 + value3)#>
<cfset v1 = (#value1#/#total_votes#) * 100>
<cfset v2 = (#value2#/#total_votes#) * 100>
<cfset v3 = (#value3#/#total_votes#) * 100>
<cfset v1 = #NumberFormat(v1)#>
<cfset v2 = #NumberFormat(v2)#>
<cfset v3 = #NumberFormat(v3)#>
And i could use the following template to handle variables coming from flash (with either the get URL command or load variables - as long as make sure that they are sent)
<!--- ecards.cfm --->
<!--- insert the data from flash into db --->
<cfquery datasource="ecards" dbtype="ODBC">
INSERT INTO cards(recipient_name, recipient_email, sender_name, sender_email, msg_body, send_date, card_type)
VALUES('#recipient_name#', '#recipient_email#', '#sender_name#', '#sender_email#', '#msg_body#', '#DateFormat(Now())#', '#card#')
If this is unclear, please let me know.
Hope this helps,
that's great - thanks!
just to clarify though your first example of getting values from a query which then Flash reads with a Load Variables action...What you're basically doing is outputing the values into the template for Flash to read - it comes aloing looking for certain variable names and as long as you've got them between <cfoutput> tages, then all is sweet.
You got the final values in your example set out like a string : &v1=#v1#&v2=#v2#&v3=#v3#&a1=#a1#&a2=#a2#&a3=#a3#&q uestion=#URLEncodedFormat(question)#&. Is this the way Flash separates the values from each other? Or could you just have (for example):
This is really helping - thanks again.
CF and Flash
Be very careful with the line breaks - Flash doesn't like whitespace. That's why they are all in on one line, with no breaks.
Also, another little trick is to include the "&" at the beginning and end. This seems to tell flash that variables are being loaded, and the one at the end says that the variables are done.
Also, you'll want to build in some kind of check in flash to make sure all the variables are loaded. I normally put a "loaded=yes" at the end of my string. Then, in flash, i have a couple of frames that check for that variable - if it's there, you can continue with the animation.
Hope this helps,
Thanks Bryan for a great answer.
You wouldn't consider doing a tutorial example? I'm sure this is a topic that would be interesting for more than a few members.
I'm glad that i could help.
I'm really having a blast with CF and Flash - I can't believe what you can do!
everyone was really helpful when i was getting started with CF and Flash (i'm still kinda getting going!!) so i'm always happy to help.
I'm kinda busy now, but i'd love to do a tutorial soon.
Thanks very much. I'd like to see a tutorial.
I'm going to have to use Flash & CF together very shortly so I'm going to learning a lot the hard way, very soon !
I might have time to put something together in the month of September.
In the meantime, please let me know if i can help you out.
cold fusion and flash
I am seriously need to start working with cold fusion cos my bos says he wants to go data base. I have no Idea at all how to deal with this issue. I read somewhere that you can only connect the two with generator.
Where do I start? and how quick can start building data base driven flash site.?
Flash and CF
Wow, that all depends.
How comfortable are you with ColdFusion (or ASP, or PHP for that matter) - and how much experience do you have with Flash?
I think I can safely say that I am an itermediat flash user. I still havent finished with actionscripts. I havent touched coldfusion or any backend stuff at all.
I gues I am a complete idiot after all
Click Here to Expand Forum to Full Width
Poll by Flashkit.com