Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / March 2007



Tip: Looking for answers? Try searching our database.

Calling coldfusion vars into flash

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mr Pappy - 29 Mar 2007 15:27 GMT
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...

<cfcontent type="application/x-www-urlform-encoded">
<cfheader name="pragma" value="no-cache">
<cfheader name="expires" value="#now()#">

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

<cfoutput><cfloop query="GetGig">
&gigdesc=#paragraphformat(getgig.gigdesc)#
</cfloop>
</cfoutput>
BKBK - 29 Mar 2007 17:58 GMT
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>
Mr Pappy - 29 Mar 2007 19:59 GMT
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?
Sojovi - 29 Mar 2007 18:44 GMT
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
Mr Pappy - 29 Mar 2007 20:01 GMT
Its as if the result doesnt loop in the Flash file...
Sojovi - 29 Mar 2007 22:59 GMT
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
SafariTECH - 30 Mar 2007 21:58 GMT
This is basically the same type of explanation, 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 under 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]i.e. CFFORM can be designed to
create Flash output.[/i]) 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.
BKBK - 31 Mar 2007 08:28 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.