开发者

How to update/store changed XML Node value in Flash/AS2?

I've succesfully loaded and parsed this XML file, using XMLParser and AS2:

<Resources>
   <item author="Julian" date="28/12/2010" time="01:18" id="876" like="8" dislike="5">
      <Text>Sample paragraph</Text>
   </item>   
   <item author="Albert" date="28/12/2010" time="01:18" id="876" like="8" dislike="5">
      <Text>Sample paragraph 2</Text>
   </item>
   <item ...
</Resource>

Now, what I need, is to increase and store the "like" and "dislike" values with the click of a button, but I don't know how to modify and store them in the existing nodes (eg., without adding开发者_JAVA技巧 new ones).

Do I need to use PHP, or can AS2 handle it by itself?

Any help on the subject? Thankyou!


you will need php. I've found the easiest thing to do is update the values in actionscript (it has an internal copy of the xml), then push the xml to your php method to write it. If you have multiple users updating the same file, you may need to have some kind of check out service so the file isn't being overwritten. This would only happen if two users updated the like/dislike at the same time. You could do without it, but something to keep in mind. Another think to keep in mind is security. You don't want anyone else calling you php method to write to your server.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜