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

coldfusion flash integration : Read XML From Flash


Pete L.
9/25/2006 9:20:38 PM
I think I might be over-thinking this, but I am at a loss on how to read an XML
packet being passed into a CF page from Flash. The Flash app sends an XML
packet to a page I choose, but on that page, how do I access the info? What is
the name of the variable? What scope is it in?

The packet looks like this: <OFFERZIP CITY="city here"
STATE="Michigan">44444</OFFERZIP>

I'm familiar with parsing the XML, once I know how to access it. I will then
do a query and return some XML back to Flash. I'm guessing I need to write a
CFC/Web Service to accept the packet? Can someone point me in the right
direction or give me an example?
meddlingwithfire
10/5/2006 6:15:44 PM
How exactly did you have Flash send the data out? Did you just make a link to
a CF page, and append the XML to the URL? Or are you using Flash Remoting, or
something else to send it out?


If the simple URL passing...
ie: http://myServer.com/index.cfm?myXML=<OFFERZIP CITY="city here"
STATE="Michigan">44444</OFFERZIP>

You could call it within the .cfm page like this:

<cfoutput>
<cfdump var="#url.myXML#">
</cfoutput>
Pete L.
10/6/2006 2:17:28 PM
The XML is just coming in as a posted XML packet to the URL/page I specify.
Anyway, I figured out how to get it done:

<cfset xmlData = "#GetHTTPRequestData()#">
<cfset xmlData = "#xmlData.content#">
<cfset xmlData = "#XmlParse(xmlData)#">
<cfset XMLzipcode = "#xmlData.offerzip.XmlText#">

There's 2 parts in the Flash movie that does this interaction, and the first
one is working fine now, but the second still doesn't I'm doing it exactly the
same way, but it doesn't even look like the XML packet is being posted. I've
tried just the first part from above ("<cfset xmlData =
"#GetHTTPRequestData()#">"), and then cffile-ing it to a file, but it doesn't
work. I'll have to check with the Flash developer to make sure this post is
working correctly.
AddThis Social Bookmark Button