Groups | Blog | Home
all groups > coldfusion flash integration > april 2006 >

coldfusion flash integration : Loading variables from cfm not working, but text document is.


iam bennu
4/14/2006 1:19:21 AM
I have created a Juke box for a client and have been loading content in with
a text file. I have had other flash movies to use a cfm to pull in content
variables from a database but I just cannot seem to get this to work.

The code in the flash jukebox movie is:

loadVariablesNum("cisum/music.cfm", 0, "GET");

The code in the music.cfm file is this:

<cfquery datasource="newbreed" name="rsGetMusic">
SELECT Music.MusicID, Music.MusicName, Music.MusicLink, Music.ArtistID,
Music.Description, Music.CollectionID, Music.Price, RISArtists.ArtistName,
RISArtists.ArtistBio
FROM Music, RISArtists
WHERE RISArtists.ArtistID = Music.ArtistID
</cfquery>
<cfset count = 1>
<cfcontent type="text/plain">
<cfoutput>SiteMusic=<cfloop
query="rsGetMusic">#rsGetMusic.MusicID#,#rsGetMusic.MusicName#,#rsGetMusic.A
rtistName#,#rsGetMusic.MusicLink#.mp3,#rsGetMusic.ArtistBio#,#rsGetMusic.Des
cription#,#rsGetMusic.ArtistID#,#rsGetMusic.CollectionID#,#LSNumberFormat(rs
GetMusic.Price,',99999999999999.99')#<cfif count NEQ
rsGetMusic.recordcount>,</cfif><cfset count=count+1></cfloop></cfoutput>



The code in the flash Newsreader movie is:

loadVariables("news.cfm", "content");

The code in the news.cfm file is this:

<cfcontent type="application/x-www-urlform-encoded">
<cfheader name="pragma" value="no-cache">
<cfheader name="expires" value="#now()#">
<cfquery datasource="newbreed" name="get_Special"
cachedwithin="#createtimespan(0, 0, 30, 0)#">
SELECT OTBSpecials.SpecialTitle, OTBSpecials.SpecialContent,
OTBSpecials.SpecialLink, OTBSpecials.SiteThumbnail
FROM OTBSpecials
</cfquery>
<cfset count = 1>
<cfoutput>
<cfloop
query="get_Special">&article_title#count#=#get_Special.SpecialTitle#&article
_content#count#=#get_Special.SpecialContent#&article_link#count#=#get_Specia
l.SpecialLink#&special_thumb#count#=#get_Special.SiteThumbnail#<cfset
count=count+1></cfloop>&no_of_feeds=#get_Special.recordcount#&
</cfoutput>



I have tried to put in the top three lines but that does not seem to do any
good. What am I missing here?

Thanks in advance,

iam bennu
reply@iamARTevolutions.net

iam bennu
4/15/2006 8:26:59 PM
More info for ya.

I tested some things and it appears that it is the string that I am putting
together and pulling in. I works find with the text file but somehow not
with cfm.

I am creating a a variable with a very long value.

"SiteMusic=25,Take The Time To Love,Ernest 'Romeo'
Polk,cisum/music3.mp3,Ernest 'Romeo' Polk Romeo is a Native of New Orleans.
He grew up in music with influences including gospel and Jazz. A virtuoso
trumpet player- Romeo has also brought a talent for arrangement and
producing to the plate.,Take The Time To Love-Upbeat and lyrical-This piece
is swings in sound and form like a coaster ride,5,1, 1.50"


That is saparated by comas. I then split it into an array that I can find
the values in.

Is there a better way to do this?

I did a test by pasting the News.cfm code into the music.cfm and changing
the variable name in the flash jukebox and it pulled in the variables fine.
I could pull these values in the same way but would have to rewrite all of
the code in the jukebox.

Pease help!

iam bennu


[quoted text, click to view]

iam bennu
4/20/2006 11:35:53 PM
I figured it out and am posting in case someone else runs across the same
problem.

I needed to format the cfm differently that the txt in that it needed an "&"
at the beginning of the phrase to pull it in. That is the way it is
formatted in the Jukebox.


I hope that it comes in handy for someone.

peace to all,

iam benu


[quoted text, click to view]

AddThis Social Bookmark Button