开发者

Flex - How to edit a xml file on the server

I was wondering if it was possible to edit an xml on the server side from a web based flex application. When you use XML files in a Flex application and then compile it to upload it in the server, Flex Buidler generates a swf file with the xml data开发者_StackOverflow中文版 embedded. How should I do to have access to those XML files??

Thanks for your answers.

Regards. BS_C3


If I understand your question you're using a XML mxml tag that embeds the XML. Try to use a URLLoader instead. Maybe like this:

var xmlLoader:URLLoader = new URLLoader();
        var myXml:XML;

        function init():void
        {
            xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
            xmlLoader.load(new URLRequest('teste.xml'));
        }
        function xmlLoaded(e:Event):void
        {
            myXml = new XML(e.target.data);
        }


You can load the content but you cannot save it back directly from Flash without calling some server side method. You should pass the new content (or delta) as a parameter to this method on the server side.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜