XML as XMLNode in ActionScript / Flex

How to get root node of an XML object in ActionScript?

You would think that I could say the following:

var Node:XMLNode = XMLVar as XMLNode;

But although XMLVar is of type XML, node will be = null.

So how do I do this?

+3
source share
2 answers
var node:XMLNode = xmlVar as XMLNode;

although xmlVar is of type XML

XMLand XMLNodeincompatible in ActionScript-3. XMLclass AS2 (and its associated classes) has been renamed flash.xml.XMLDocumentto AS3.

XMLNode/XMLDocument XML, ActionScript 2.0 ActionScript 3.0. ActionScript 3.0 XML , E4X (ECMAScript XML). XMLNode/XMLDocument .

XML XMLNode. as, null , , , .


, lowerCase , UpperCase .

+1

, . Adobe AS3.

var xmlData:XML = new XML();
var node:XMLNode = xmlData.firstChild();

, .

XML firstChild. node XMLNode.

+1

Source: https://habr.com/ru/post/1747284/


All Articles