7 Replies Latest reply on Mar 31, 2007 12:28 AM by BKBK

    Calling coldfusion vars into flash

    Mr_Pappy
      Hi

      I am calling data into flash from a coldfusion page.

      I want all "gigdescriptions" where ADMIN ID = 6 .... there are 5 results to that query.

      However, I only see the lastest one when I call the variables into flash.

      In flash, i simply call the var_name into a textblock.

      I want all my results to display, not only one...

      Please help!

      Thanks again.
      Mr Pappy

      This is my Coldfusion code...
        • 1. Re: Calling coldfusion vars into flash
          BKBK Adobe Community Professional & MVP
          Down to the basics. Does this display what you want?

          <cfquery datasource="#application.db#" name="GetGig">
          select *
          from tblGigs
          WHERE ADMINID = 6
          </cfquery>

          <cfoutput query="GetGig">
          #paragraphformat(getgig.gigdesc)#
          </cfoutput>

          • 2. Re: Calling coldfusion vars into flash
            Sojovi Level 1
            You are using 5 times the same variable name.. so the var is "overwrited" in Flash and you get only the last one.
            You need the to concatenate the getgig.gigdesc and show it in the textbox ? Or you have different textboxes ?

            REgards
            • 3. Re: Calling coldfusion vars into flash
              Mr_Pappy Level 1
              Hi

              If i call the data in coldfusion, i get all my records...
              But when i call it into flash, only my 1st record shows.

              I have a feeling the problem may come from within flash.

              Can I perhaps send a file for you to take a look at?
              • 4. Re: Calling coldfusion vars into flash
                Mr_Pappy Level 1
                Its as if the result doesnt loop in the Flash file...
                • 5. Re: Calling coldfusion vars into flash
                  Sojovi Level 1
                  I don't know if I get it rigth your situation, but I suppose something like :
                  You CF page returns the query in the url encoded var format (var=1&var2=2&var=3...)
                  And in your flash, you have the loadvars or loadvariables("cfpage.cfm")
                  That will return the vars defined in the cfpage in your Flash (var, var1..)

                  Now.. how are you trying to use this vars in the Flash file ?...

                  You can't loop the result, you don't receive a recordset, just a collection of variables. Copy the code or send it if you prefer.. both CF and Actionscript.

                  Regards
                  • 6. Calling coldfusion vars into flash
                    SafariTECH Level 1
                    This is basically the same type of explanation as from Sojovi, but it stems from the fact that CF is a server side tehcnology and Flash is a client side technology.

                    In your situation, Flash is not loaded until after all the processing is done and CF can only feed it whatever the last variable was. As stated, the variable is technically being overwritten (or replaced) over and over until the last one is recorded. This is why you only see the one record.

                    In order to get the results you want, you either need to build an output using the appropriate Flash generating tags in CF ( i.e. CFFORM can be designed to create Flash output.) or you have to create a data or xml connector in your own flash file using actionscript so it will draw the data itself.

                    You could compromise a bit and do both ... have Flash call an XML file for its data, but target a CF page that generates an XML output.

                    • 7. Re: Calling coldfusion vars into flash
                      BKBK Adobe Community Professional & MVP
                      The key is to leave your CFML code intact, irrespective of how you intend to use Flash. There are ways to just pass the query to Flash as a recordset.