Flash - XML Tutorial - The BasicsBy Joachim SchnierPreloading XML filesOne of the problems I encountered was when I used a button to load and at the same time parse the XML file, it worked fine on my harddrive but not on the server. Therefore, especially for large files it was necessary to preload the XML file first. I have provided a XmlPreloader component in the tutorial package and its action is shown here.
You can preload up to ten XML files ore text (.txt) files. If you don't want to use the component create a movieclip and on a keyframe of the movieclip timeline put this script inside: myXML = new XML(); myXML.load("myfilename.xml"); myXML.onLoad = function(success){ if(success){ trace(this.getBytesLoaded()); } }The trace action will give you the bytes. And this is the end of the tutorial. If you want to see a more sophisticated version of this search engine check the XML database Component. Now if you find some some bug or mistakes which I made, let me know. Also I have not at all discussed the possibilities to use XML to communicate with a server. However, I have listed some tutorials in the sidebar, which are addressing this question and which you might find useful.
|