How do I get the root node of an XML object in Actionscript?
One would think that I could say this:
var Node:XMLNode = XMLVar as XMLNode;
But although XMLVar is of type XML, Node will = null.
So how do I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XMLandXMLNodeare not compatible in ActionScript-3.XMLclass of AS2 (and its related classes) has been renamed toflash.xml.XMLDocumentin AS3.An object of type
XMLcannot be cast directly toXMLNode. Since you’re trying to cast withaskeyword, it just returnsnullinstead of raising an alarm saying the cast failed.And as already mentioned, consider using lowerCase names for variables, as UpperCase names are normally used for naming classes.