• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Calling coldfusion vars into flash

Explorer ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

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...
TOPICS
Advanced techniques

Views

512

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

Its as if the result doesnt loop in the Flash file...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 29, 2007 Mar 29, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 30, 2007 Mar 30, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2007 Mar 31, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation