Skip to main content
April 28, 2006
Question

Generate coldfusion xml file

  • April 28, 2006
  • 2 replies
  • 405 views
Hello everyone,

i've been using cffile > write to create xml files to use in my flash.
i was wondering if i can generate a coldfusion xml-file that can be read like a regular xml file by flash eg.
This way i could read from xml on the fly instead of creating and delete xml files each time i need some information...

Tnx for any help

Greetz,

Yannovich
This topic has been closed for replies.

2 replies

May 3, 2006
Tnx hotcfm and Abinidi,

i'm still nog though this though...

tnx for any help!

first i tried reading my cfpage in flash as if it where an xml document:
--------------------------------------------------------------------------------------------
flash:

xml_detail=new XML();
xml_detail.ignoreWhite=true;
xml_detail.onLoad=do_initxml;
xml_detail.load("test.cfm?r="+random(65453121564876));

coldfusion test.cfm:
<cfoutput>#myXMLer#</cfoutput>


then i tried and change my code so to use cfxml and a variable name:
---------------------------------------------------------------------------------------------
flash:
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
var str_xml= result_lv.myXMLer;
xml_detail=new XML(str_xml);
t_result.text=str_xml
gotoAndPlay(_currentframe+1)
} else {
t_result.text = "Error connecting to server.";
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.r = random(12134567864512345)
send_lv.sendAndLoad("test.cfm", result_lv, "POST");

coldfusion test.cfm:
<cfxml variable="myXMLer">
<inhoud>
<w id="test" />
</inhoud>
</cfxml>

Participating Frequently
April 28, 2006
sure,if you use cffile to generate a xml file ,

it can be use by flash eg.

you can write the content in the cfsavecontent for a variable.

and use cffile to write the variable to a xml format file.

understand?
Inspiring
April 28, 2006
Look up the use of the CFXML tag. It will generate xml as a variable and then you can reference that Variable in FLash. It will also completely depend on how you build the flash app as well.