Flash forms to Cold Fusion
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Flash forms to Cold Fusion

  1. #1
    Junior Member
    Join Date
    Feb 2000
    Posts
    14

    Post

    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.

    ------------------
    <!--phantom-->

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    Flash and ColdFusion

    I've had a lot of success with flash and coldfusion.

    what do you need to know???


  3. #3
    Junior Member
    Join Date
    Feb 2000
    Posts
    14
    well...

    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.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    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">
    SELECT
    *
    FROM question_archive
    WHERE question LIKE '#question#'
    </cfquery>

    <cfoutput query="get_results">
    <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)#>
    </cfoutput>

    <cfoutput query="get_results">
    &v1=#v1#&v2=#v2#&v3=#v3#&a1=#a1#&a2=#a2#&a3=#a3#&q uestion=#URLEncodedFormat(question)#&
    </cfoutput>


    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#')
    </cfquery>

    If this is unclear, please let me know.

    Hope this helps,

    Rgds,

    Bryan

  5. #5
    Junior Member
    Join Date
    Feb 2000
    Posts
    14
    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):

    <cfoutput>
    v1=#v1#
    v2=#v2#
    etc
    </cfoutput>

    This is really helping - thanks again.

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    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,

    Bryan

  7. #7
    Member
    Join Date
    May 2000
    Posts
    85
    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.


    Cheers,

    Evildrome.

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    CF Tutorial

    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.


  9. #9
    Member
    Join Date
    May 2000
    Posts
    85
    Bryan,

    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 !


    Thanks,

    Evildrome.



  10. #10
    Senior Member
    Join Date
    Jun 2000
    Posts
    108
    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.


  11. #11
    Junior Member
    Join Date
    Aug 2000
    Posts
    9

    cold fusion and flash

    great,
    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.?

    Help

  12. #12
    Senior Member
    Join Date
    Jun 2000
    Posts
    108

    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?


  13. #13
    Junior Member
    Join Date
    Aug 2000
    Posts
    9

    bryan

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com