|
There's a rule about posting for help with Actionscript - you always find the answer immediately after you ask. I guess putting it in words helps me think of new ways to search for the answer - I don't know.
Anyway, apparantly there is such an object as XML.contentType in Flash and it need to by "application/xml" for this to work. Sorry for my dumbassity, and I'll try to put together a tutorial after I flesh this out a bit further. =P
In the mean time, if somebody wants to use this plugin to integrate Rails and Flash, try this actionscript (You need a titlebox and a descriptionbox text field, as well as a sendButton movieclip). Insert this code in the timeline:
~~~~~~~~~~~
stop();
sendButton.onRelease = function() {
//send the XML formatted data to the server
var bookXML:XML = new XML("<book><title>"+titlebox.text+"</title><description>"+descriptionbox.text+"</description></book>");
trace(bookXML);
bookXML.contentType="application/xml";
bookXML.send("http://localhost:3000/books/");
}
|