Flash ActionScript >> update xml file sample

by art-v » Tue, 27 Dec 2005 16:54:23 GMT

I use the file (XML_LanguagePicker) from the \Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript
how can update the data in flash automaticlly , when I chang from .xml file in this sample.


Flash ActionScript >> update xml file sample

by yachts99 » Tue, 27 Dec 2005 17:35:32 GMT


Do you mean that you want the swf to update itself every time you make a change to the xml file? If so, you will have to periodically reload the xml, using setInterval for instance.



Flash ActionScript >> update xml file sample

by art-v » Tue, 27 Dec 2005 18:42:04 GMT

can you please write a sample script for this ,note i write this script in
flash

import mx.containers.Window;
var languageXML:XML = new XML();
var masterArray:Array = new Array();
languageXML.ignoreWhite = true;
languageXML.onLoad = function(success) {
var currentLangNode:XMLNode = this.firstChild.firstChild;
var i:Number = 0;
for (var childNode = currentLangNode; childNode != null; childNode =
childNode.nextSibling, i++) {
var j:Number = 0;
masterArray = new Array();
masterArray[0] = childNode.nodeName;
j++;
for (var stringNode:XMLNode = childNode.firstChild; stringNode != null;
stringNode = stringNode.nextSibling, j++) {
masterArray[j] = stringNode.firstChild.nodeValue;
}
}

for (var k=0; k < masterArray.length; k++) {
lang_cb.addItem(masterArray[k][0]);
}

name.name.text = masterArray[0][1];
chat.chat.text = masterArray[0][2];
}

var langListener:Object = new Object();
langListener.change = function (eventObj) {
for (var l=0; l < masterArray.length; l++) {
if (masterArray[l][0] == eventObj.target.value) {
welcome_txt.text = masterArray[l][1];
thanks_txt.text = masterArray[l][2];
break;
}
}
}

lang_cb.addEventListener("change",langListener);
languageXML.load("1.xml");

and I have an xml file 1.xml
<strings>
<English>
<greeting>car</greeting>
<thanks>two</thanks>
</English>
</strings>




Similar Threads

1. Looking for sample thats loads an XML file and updates some records - CSharp/C#

2. Visual FoxPro XML Web Service Sample won't Update

I get that the Customer Cursor is read only... 

Tried it on two machines and no luck.

Any thoughts... I can make changes to the table directly through Fox.

Thanks

Scott

3. XML sample file from given XSD file

4. Looking for sample XML to sample XSD

Has anyone seen a XSLT stylesheet that will back-engineer a XML Schema from
a sample XML document, much like the way XMLSpy allows you to do the same.
I don't want to have to use XMLSPy everytime.

I know the schema that this XSLT could produce would not be as good as doing
the Schema from scratch but it's a nice stylesheet to illustrate the power
of XSL.


Cheers
-Ruairi


5. Treeview updates not showing on rebind but fxml file is updated - Asp.Net

6. Update an xml file from flash

Hi, I have tried out samples showing how to bind components in a flash 
application to XML files. What I need is a way to update an xml file from my 
flash application. Is this possible? And if so, can I do that without going 
trough a database? If anyone have a sample or a link to a sample concerning 
this matter I would been very thankful.


 TIRislaa   


7. Create new XML file or update existing

8. Updating the XML file for flash input from an external application

Hi,

I'm using an XML file to control the dynamic attributes of a FLASH
file. And i need this file to be updated for every 2 secs, by another
application (could be a java servlet). How to avoid the synchronisation
issue here, when my application is writing to the XML file & flash is
reading from the XML file

Appreciate your help on this.

Thanks