Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-29-2003, 10:43 PM   #1
zone22
Registered User
 
Join Date: Aug 2003
Posts: 2
Lightbulb XML Editor?

Hi does anybody know how to make a flash movie that can online edit the xml files and also save it again on your website ?
zone22 is offline   Reply With Quote
Old 08-30-2003, 07:03 AM   #2
snapple
member
 
snapple's Avatar
 
Join Date: Feb 2002
Location: London
Posts: 2,442
Default

zone22,

You edit XML files by using:
ActionScript Code:
var keepCount = _root.XMLmenu.myXMLdoc.firstChild.childNodes.length;          myNewDoc = _root.XMLmenu.myXMLdoc;                                 //define the node and NAME that node, in this case, USER_SITE, SITE_COMMENT, DATE - if you've used the example you'll see what i mean.         newNode = myNewDoc.createElement("USER_SITE");                                 //again here (i had three pieces of info)         newNodeTwo = myNewDoc.createElement("SITE_COMMENT");                                 //and here          newNodeThree = myNewDoc.createElement("DATE");                                 //here we actually fill in our newly created node with text, as you can see the end name is an input text field eg. comment, date         newtext = myNewDoc.createTextNode(_root.XMLmenu.control.comment);         newTextTwo = myNewDoc.createTextNode(_root.XMLmenu.control.date);                                 //decide where your going to put your node using append child         myNewDoc.firstChild.appendChild(newNode);         myNewDoc.firstChild.childNodes[keepCount].appendChild(newNodeTwo);         myNewDoc.firstChild.childNodes[keepCount].appendChild(newNodeThree);         myNewDoc.firstChild.childNodes[keepCount].childNodes[0].appendChild(newText);         myNewDoc.firstChild.childNodes[keepCount].childNodes[1].appendChild(newTextTwo);         myNewDoc.firstChild.childNodes[keepCount].attributes.url = _root.XMLmenu.control.address; //these are just funtion i call to create the menu         _root.XMLmenu.createURLClip();         _root.XMLmenu.createDateClip();         _root.XMLmenu.listURL(myNewDoc);         _root.XMLmenu.listDate(myNewDoc);

This was the code (not optimised), i used for exactly the purpose you want, you can see it here:

http://www.uzi-lover.com/xml


But if youtry it out you will very soon realise that it does not perminantly update the XML doc, i think that this is only do-able with the combination of php and xml (one i'm working on now).

Unless i have a massive gap in my XML knowledge, either that or just built that fla wrong, lol


Kirupa, has a good tutorial on editing XML files in flash, also AS the definitive guide has a good reference section. But look on kirupa !!!

Basically use:

ActionScript Code:
createElement appendChild createTextNode appendChild

This is the link you want:

http://www.kirupa.com/developer/acti...e_edit_xml.htm

snapple

Last edited by snapple; 08-30-2003 at 07:16 AM.
snapple is offline   Reply With Quote
Old 08-30-2003, 08:06 AM   #3
zone22
Registered User
 
Join Date: Aug 2003
Posts: 2
Thumbs up

HEy thnx this helps alot
zone22 is offline   Reply With Quote
Old 08-30-2003, 09:55 AM   #4
snapple
member
 
snapple's Avatar
 
Join Date: Feb 2002
Location: London
Posts: 2,442
Default

Not a problem
snapple is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:22 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.