Photoshop Tutorials, Flash Tutorials, 3Ds Studio Max Tutorials, Web Design Tutorials |
![]() |
|
:: Free Website Templates
Welcome To WebDesignTutorials.net Flash Tutorials Area - Flash and XML
![]() var contacts = new XML(); contacts.ignoreWhite = true; var entry = 0; var total = 0; var current = 0; contacts.load("contacts.xml"); contacts.onLoad = function(success) { if (success) { name_txt = this.firstChild.childNodes[_root.entry].attributes.name; email_txt = this.firstChild.childNodes[_root.entry].attributes.email; web_txt = this.firstChild.childNodes[_root.entry].attributes.website; _root.total = this.firstChild.childNodes.length; _root.current = _root.entry + 1; entryNum_txt = _root.current+" of "+ _root.total; } }; The line name_txt = this.firstChild.childNodes[_root.entry].attributes.name; tells flash to look into the xml file just loaded (this) then move down to the first node or xml element (.firstChild) and then move down to the appropriate entry (.childNodes[_root.entry]) and finally to grab the appropriate data (attributes.name). Our xml file contains a main element of contacts and under that we have a list of entries. childNodes[0] is the first node, childNodes[1] is the second node and so on. The next thing we are doing is telling flash how many total entries there are so we can see how many we have to browse through. Then we tell flash which entry we are currently looking at. We add one to _root.entry because 0 is the first element in the node array, but we want it to show that we are looking at entry 1, not entry 0. Then we output which entry we are looking at out of how many. on(press) {
if(_root.entry + 1 == _root.total) {
_root.entry = 0;
} else {
_root.entry += 1;
}
_root.contacts.load("contacts.xml");
}
on(press) {
if(_root.entry == 0) {
_root.entry = _root.total - 1;
} else {
_root.entry -= 1;
}
_root.contacts.load("contacts.xml");
}
Author: Jacob Bullock
|
|
||||||||||||||||||||||||||||||||
Premium Partners |
| Free Website Templates - Flash templates, Affordable Website Design, Website Templates, Website Redesign, Custom Website Design, Web Design Tutorials, Flash Tutorials, Promotion Tutorials - that is what we do. Metamorphosis Design Studio offers quality, free and low cost web site templates for your business and personal life, we also offer affordable web design and site re-design. |
| Vertex Website Tempales - It saves tones of time and money to use pre-made web designs to build your web site. You need a web site but you don't want to pay thousands dollars to professional web design companies? Our web templates is just for you! They are designed to be easilly edited by your favorite html editor, like MS FrontPage |
| Photoshop Tutorials - Learn how to build stunning web pages using Adobe Photoshop, Macromedia Flash MX and 3D Studio Max software. The step-by-step approach makes it so easy, that even beginners can produce great web pages. Get started with these tutorials covering everything from page layout to content tips. |
Free website templates and paid web templates are great tools to make your websites look perfect! You will save time and money with our flash templates and free website templates
Our visitors are satisfied with the quality of our free and paid website templates! Please visit our free website templates and paid website templates sections. We offer free web templates, free web layouts, free web page templates and other stuff for free download. All templates come with the html and external css file so you may easily edit HTML with your favorite HTML editor. Feel free to download our free web templates for your personal websites. Terms of use depend upon the website template vendor. |
| Home | Submit Tutorial | Top Sites | Free Templates | Website Templates | Privacy Policy | Contact Us |
| All Right Reserved by WebDesignTutorials.net |