The XMLShortcuts component enables shortcut access to All XML nodes.
Biggest advantage of using XML shortcuts is it can be easily added to existing projects with out any modification. Simply drag and drop the component from components window to the stage and then delete it from stage (let it stay in the library).
Note: Replace childNode, index, and attribute with their respective values. See the example below
<english> <a word="apple">a for apple</a> <a word="Arul">a for Arul</a> <b word="ball">b for ball</b> <b word="bee">b for bee</b> <c word="cat">c for cat</c> <c word="cow">c for cow</c> </english>
Using the XML above
Caution: Avoid data type declaration while initializing XML and XMLNode
for example the following code will throw a compiler error “There is no property with the name ‘x'”
[cc lang=”actionscript3″]var myXML:XML = new XML (“<x><y/><x>”); trace (myXML.x); [/cc]
Where as the following code works fine
[cc lang=”actionscript3″]var myXML = new XML (“<x><y/><x>”); trace (myXML.x);
Hope it is of some use to everyone using flash and xml in their day to day life. Feel free to express your views in the comment, I will be glad to hear from you 🙂