Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
Donna Casey #1
advice needed... cf write data to xml file for use in flash app thatuses xml file
I'm wondering if it is possible to use CF to:
1) connect to existing db;
2) get specific data from table;
3) write it to an xml file that would follow a specific format and
include the output data;
4) that a flash newsticker (flashloaded.com's newsticker) could use
I ask because I want to use the flashloaded newsticker app and this
project already has a database and can be hosted on an existing cf
server. So I guess I am asking how hard it would be for qualified cf
developer to write out the data to the xml file? The ticker reads a
static xml file, so if cf can write that, I can tell the project manager
that the solution is feasible and reasonable budget-wise.
I'm no cf developer, but shouldn't you be able to have coldfusion write
a static file using any tags you tell it to, putting the text (data) in
them?
Advice sought and appreciated. thanks!
Donna
Donna Casey Guest
-
Flash Player won't write .SOL file
Using a downloaded flash player application (game called telescope from www.dyson.uk.com) on three different computers. All computers running XP... -
write value from flash file to an external file
how can I write value from flash file to an external file like (text file or xml file) -
How do I parse a txt File and write data into aDatabase
I'm trying to do an insert off of your example. It keeps throwing an error that it doesn't understand "fields1." Can you tell me where I might be... -
Write to file with flash
Hi I know how to read from a file with flash, but how can i write to a file? desperate ohad (ohad_m@msn.com) -
Please Advice. What´s the right path? plain file vs xml file
Hello Everybody! I´d like that you give me some advice on what the right approach to import some data from one system to another is. I know that... -
dr_bozak #2
Re: advice needed... cf write data to xml file for usein flash app that uses xml file
yeah .. this is real easy.
if you have cf 5 or earlier, you can just translate your existing xml doc into
a db, and then write a query, that builds a string and outputs to a file.
in cf 6.1 and later (i think)
you can just tell Cf that you want the query returned as xml
either way, it works easily.
I have only experience with the old method, but it;s not very tough. I think
it took me an hour.
dr_bozak Guest
-
Donna Casey #3
Re: advice needed... cf write data to xml file for use in flashapp that uses xml file
dr_bozak wrote:
Thanks, dr_bozak. What I am wondering about is just the opposite--there> yeah .. this is real easy.
>
> if you have cf 5 or earlier, you can just translate your existing xml doc into
> a db, and then write a query, that builds a string and outputs to a file.
>
> in cf 6.1 and later (i think)
> you can just tell Cf that you want the query returned as xml
>
>
> either way, it works easily.
> I have only experience with the old method, but it;s not very tough. I think
> it took me an hour.
>
>
>
already is a database and an application that is written in CF to query
the data and then put it in an html page... there are also admin pages
to write to the database (to add content)
Instead, I want to display that same data from the cf query in the
flashloaded.com newsticker app, which reads an xml file. So, the
question is how feasible it is to get CF to query the db and write out
that data into the xml page or, if easier, to simply create the xml page
with the required tags and data?
The xml file uses the typical assortment of tags:
<?xml version="1.0" ?>
<ticker>
<topic>
<text>
<![CDATA[
<b>June 28, 2005 <br /><font color="#FFFFFF">blah,
blah</font></b><br><i>blah, blah</i>]]>
</text>
<link>http://www.mydomain.com/whereever.cfm</link>
<target>_self</target>
<targetIsUrl>Y</targetIsUrl>
</topic>
</ticker>
Possible?
tia, Donna
Donna Casey Guest
-
Donna Casey #4
Re: advice needed... cf write data to xml file for use in flashapp that uses xml file
What I am curious about is whether CF can
1) write to an existing xml file?
2) write a new xml file?
3) what is the method used assuming the general assortment of data, like
#tickerdate# #tickernewstext# and #tickerlink#, blah, blah?
I am assuming that it actually writes the content, but can it also write
the necessary tags required by the flash app, or would you use some sort
of template that already has those or would you concactenate the tags
with the data references to produce a string that is then written to an
xml file?
Like I said, I'm no backend developer, but I have a general picture of
how it works and just want to be solid in saying what will or won't work
and how.
thanks so much all,
Donna
Donna Casey Guest
-
dr_bozak #5
Re: advice needed... cf write data to xml file for usein flash app that uses xml file
1) write to an existing xml file?
2) write a new xml file?
3) what is the method used assuming the general assortment of data, like
#tickerdate# #tickernewstext# and #tickerlink#, blah, blah?
I am assuming that it actually writes the content, but can it also write
the necessary tags required by the flash app, or would you use some sort
of template that already has those or would you concactenate the tags
with the data references to produce a string that is then written to an
xml file?
Like I said, I'm no backend developer, but I have a general picture of
how it works and just want to be solid in saying what will or won't work
and how.
thanks so much all,
Donna
dr_bozak Guest
-
dr_bozak #6
Re: advice needed... cf write data to xml file for usein flash app that uses xml file
1) write to an existing xml file?
* Yes. you use cffile to do this.
2) write a new xml file?
* again, you use CFFILE to do this
3) what is the method used assuming the general assortment of data, like
#tickerdate# #tickernewstext# and #tickerlink#, blah, blah?
* as I mentioned, you can query your db to retrieve the data in your existing
DB, and write it out as XML to match your existing document.
I am assuming that it actually writes the content, but can it also write
the necessary tags required by the flash app,
*tags aside from XML?
or would you use some sort
of template that already has those or would you concactenate the tags
with the data references to produce a string that is then written to an
xml file?
* thats the old school way to do it. which is how I did it, (pre MX)
check out how I did it: this is coming from a single table, but should show
you one method. again, with CFMX there is cleaner way to do it (although this
method for me produced a pretty xml doc that looked right, but must have had
extra charcters in it, as it didn't work)
<!----- heres the code ---->
<cfset thisDS = "everb">
<cfquery datasource="#thisDS#" name="getSeasons">
Select * FROM seasons order by id DESC
</cfquery>
<cfset thisString = "<?xml version=""1.0""
encoding=""UTF-8""?><everb><seasons>">
<cfloop query="getSeasons">
<cfset currentSeason = (getSeasons.recordcount+1) - getSeasons.currentrow>
<cfquery datasource="everb" name="getSeasonPics">
Select images.image, images.id from images, seasonImage, seasons
where images.id = seasonimage.imgid AND seasonImage.seasonID = seasons.id
AND seasons.id = #getSeasons.id# order by images.id ASC
</cfquery>
<cfset thisString = thisString & "<season idName=""#seasonname#""
id=""#currentSeason#"">">
<cfloop query="getSeasonPics">
<cfset thisString = thisString & "<img>#image#</img>">
</cfloop>
<cfset thisString = thisString & "</season>">
</cfloop>
<cfset thisString = thisString & "</seasons><main><nav idName=""everB
Profile""></nav><nav idName=""Stores""></nav><nav
idName=""Contact""></nav></main></everb>">
<cffile action="write" file="#thepath#\everb.xml" nameconflict="overwrite"
output="#thisString#">
</cffile>
<!--- end of code ---->
and here is the xml it made from the db ....
<?xml version="1.0" encoding="UTF-8"?><everb><seasons><season idName="season5"
id="5"><img>crypto_snap.jpg</img><img>crypto_success.jpg</img></season><season
idName="pwned" id="4"><img>IMG_605.jpg</img></season><season idName="season3"
id="3"><img>ebt07.jpg</img><img>ebt14a.jpg</img><img>ebt14b.jpg</img></season><s
eason idName="Fresh"
id="2"><img>ebs01.jpg</img><img>ebt09.jpg</img></season><season idName="You own
dawg"
id="1"><img>ebj01.jpg</img><img>ebt02.jpg</img><img>ebt03.jpg</img></season></se
asons><main><nav idName="everB Profile"></nav><nav idName="Stores"></nav><nav
idName="Contact"></nav></main></everb>
let me know if that helps. You can defintely do what you are asking, and I'm
pretty sure I understand.
you have existing db and cf queries, that you want to use to create an XML doc
that will be later read by flash. the xml doc created needs to match the format
exactly to feed the flash movie.
the above example will show you the old way.
the new way ....
well ...
type xml coldfusion into google, or check out the livedocs example for MX.
dr_bozak Guest
-
Donna Casey #7
Re: advice needed... cf write data to xml file for use in flashapp that uses xml file
Thanks! I haven't had time to check this out, but it looks like what I
thought would work. When I get time to put it together, I'll get back to
you with the results...
I'd give you my first-born, but she's 27 and her husband might object!
donna
dr_bozak wrote:> 1) write to an existing xml file?
> * Yes. you use cffile to do this.
> 2) write a new xml file?
> * again, you use CFFILE to do this
>
> 3) what is the method used assuming the general assortment of data, like
> #tickerdate# #tickernewstext# and #tickerlink#, blah, blah?
> * as I mentioned, you can query your db to retrieve the data in your existing
> DB, and write it out as XML to match your existing document.
>
> I am assuming that it actually writes the content, but can it also write
> the necessary tags required by the flash app,
> *tags aside from XML?
>
> or would you use some sort
> of template that already has those or would you concactenate the tags
> with the data references to produce a string that is then written to an
> xml file?
> * thats the old school way to do it. which is how I did it, (pre MX)
>
> check out how I did it: this is coming from a single table, but should show
> you one method. again, with CFMX there is cleaner way to do it (although this
> method for me produced a pretty xml doc that looked right, but must have had
> extra charcters in it, as it didn't work)
>
>
> <!----- heres the code ---->
>
> <cfset thisDS = "everb">
> <cfquery datasource="#thisDS#" name="getSeasons">
> Select * FROM seasons order by id DESC
> </cfquery>
>
> <cfset thisString = "<?xml version=""1.0""
> encoding=""UTF-8""?><everb><seasons>">
> <cfloop query="getSeasons">
> <cfset currentSeason = (getSeasons.recordcount+1) - getSeasons.currentrow>
> <cfquery datasource="everb" name="getSeasonPics">
> Select images.image, images.id from images, seasonImage, seasons
> where images.id = seasonimage.imgid AND seasonImage.seasonID = seasons.id
> AND seasons.id = #getSeasons.id# order by images.id ASC
> </cfquery>
> <cfset thisString = thisString & "<season idName=""#seasonname#""
> id=""#currentSeason#"">">
> <cfloop query="getSeasonPics">
> <cfset thisString = thisString & "<img>#image#</img>">
> </cfloop>
> <cfset thisString = thisString & "</season>">
> </cfloop>
> <cfset thisString = thisString & "</seasons><main><nav idName=""everB
> Profile""></nav><nav idName=""Stores""></nav><nav
> idName=""Contact""></nav></main></everb>">
>
>
> <cffile action="write" file="#thepath#\everb.xml" nameconflict="overwrite"
> output="#thisString#">
> </cffile>
>
> <!--- end of code ---->
>
>
> and here is the xml it made from the db ....
>
> <?xml version="1.0" encoding="UTF-8"?><everb><seasons><season idName="season5"
> id="5"><img>crypto_snap.jpg</img><img>crypto_success.jpg</img></season><season
> idName="pwned" id="4"><img>IMG_605.jpg</img></season><season idName="season3"
> id="3"><img>ebt07.jpg</img><img>ebt14a.jpg</img><img>ebt14b.jpg</img></season><s
> eason idName="Fresh"
> id="2"><img>ebs01.jpg</img><img>ebt09.jpg</img></season><season idName="You own
> dawg"
> id="1"><img>ebj01.jpg</img><img>ebt02.jpg</img><img>ebt03.jpg</img></season></se
> asons><main><nav idName="everB Profile"></nav><nav idName="Stores"></nav><nav
> idName="Contact"></nav></main></everb>
>
>
>
> let me know if that helps. You can defintely do what you are asking, and I'm
> pretty sure I understand.
> you have existing db and cf queries, that you want to use to create an XML doc
> that will be later read by flash. the xml doc created needs to match the format
> exactly to feed the flash movie.
>
> the above example will show you the old way.
>
> the new way ....
>
> well ...
>
> type xml coldfusion into google, or check out the livedocs example for MX.
>
>
>
>
>
>Donna Casey Guest
-
Donna Casey #8
Re: advice needed... cf write data to xml file for use in flashapp that uses xml file
Hello, again, dr_bozak
I'm taking a look at this now and I think I understand it. My question is :
Do I put my modified version (with my ds, query and xml requirements) in
the HEAD of the page that runs the flash app that reads the resulting
xml file?
Or would the database need to be queried before the flash app page is
loaded into the browser (for example, the flash app will be an element
on the homepage of the site, so would it run as the homepage loads or do
I send the user through another page that triggers the xml file write
and directs the user to the "real" homepage)?
Donna
dr_bozak wrote:> 1) write to an existing xml file?
> * Yes. you use cffile to do this.
> 2) write a new xml file?
> * again, you use CFFILE to do this
>
> 3) what is the method used assuming the general assortment of data, like
> #tickerdate# #tickernewstext# and #tickerlink#, blah, blah?
> * as I mentioned, you can query your db to retrieve the data in your existing
> DB, and write it out as XML to match your existing document.
>
> I am assuming that it actually writes the content, but can it also write
> the necessary tags required by the flash app,
> *tags aside from XML?
>
> or would you use some sort
> of template that already has those or would you concactenate the tags
> with the data references to produce a string that is then written to an
> xml file?
> * thats the old school way to do it. which is how I did it, (pre MX)
>
> check out how I did it: this is coming from a single table, but should show
> you one method. again, with CFMX there is cleaner way to do it (although this
> method for me produced a pretty xml doc that looked right, but must have had
> extra charcters in it, as it didn't work)
>
>
> <!----- heres the code ---->
>
> <cfset thisDS = "everb">
> <cfquery datasource="#thisDS#" name="getSeasons">
> Select * FROM seasons order by id DESC
> </cfquery>
>
> <cfset thisString = "<?xml version=""1.0""
> encoding=""UTF-8""?><everb><seasons>">
> <cfloop query="getSeasons">
> <cfset currentSeason = (getSeasons.recordcount+1) - getSeasons.currentrow>
> <cfquery datasource="everb" name="getSeasonPics">
> Select images.image, images.id from images, seasonImage, seasons
> where images.id = seasonimage.imgid AND seasonImage.seasonID = seasons.id
> AND seasons.id = #getSeasons.id# order by images.id ASC
> </cfquery>
> <cfset thisString = thisString & "<season idName=""#seasonname#""
> id=""#currentSeason#"">">
> <cfloop query="getSeasonPics">
> <cfset thisString = thisString & "<img>#image#</img>">
> </cfloop>
> <cfset thisString = thisString & "</season>">
> </cfloop>
> <cfset thisString = thisString & "</seasons><main><nav idName=""everB
> Profile""></nav><nav idName=""Stores""></nav><nav
> idName=""Contact""></nav></main></everb>">
>
>
> <cffile action="write" file="#thepath#\everb.xml" nameconflict="overwrite"
> output="#thisString#">
> </cffile>
>
> <!--- end of code ---->
>
>
> and here is the xml it made from the db ....
>
> <?xml version="1.0" encoding="UTF-8"?><everb><seasons><season idName="season5"
> id="5"><img>crypto_snap.jpg</img><img>crypto_success.jpg</img></season><season
> idName="pwned" id="4"><img>IMG_605.jpg</img></season><season idName="season3"
> id="3"><img>ebt07.jpg</img><img>ebt14a.jpg</img><img>ebt14b.jpg</img></season><s
> eason idName="Fresh"
> id="2"><img>ebs01.jpg</img><img>ebt09.jpg</img></season><season idName="You own
> dawg"
> id="1"><img>ebj01.jpg</img><img>ebt02.jpg</img><img>ebt03.jpg</img></season></se
> asons><main><nav idName="everB Profile"></nav><nav idName="Stores"></nav><nav
> idName="Contact"></nav></main></everb>
>
>
>
> let me know if that helps. You can defintely do what you are asking, and I'm
> pretty sure I understand.
> you have existing db and cf queries, that you want to use to create an XML doc
> that will be later read by flash. the xml doc created needs to match the format
> exactly to feed the flash movie.
>
> the above example will show you the old way.
>
> the new way ....
>
> well ...
>
> type xml coldfusion into google, or check out the livedocs example for MX.
>
>
>
>
>
>Donna Casey Guest



Reply With Quote

