@awayfl/avm1
Version:
Virtual machine for executing AS1 and AS2 code
87 lines (86 loc) • 3.97 kB
JavaScript
import { __extends } from "tslib";
import { XMLNode } from './XMLNode';
import { XMLNodeType } from './XMLNodeType';
/**
* The XMLDocument class represents the legacy XML object
* that was present in ActionScript 2.0. It was renamed in ActionScript 3.0
* to XMLDocument to avoid name conflicts with the new
* XML class in ActionScript 3.0. In ActionScript 3.0,
* it is recommended that you use the new
* <xref href="../../XML.html" class="- topic/xref ">XML</xref> class and related classes,
* which support E4X (ECMAScript for XML).
*
* <p class="- topic/p ">The XMLDocument class, as well as XMLNode and XMLNodeType, are present for backward
* compatibility. The functionality for loading XML documents can now be found in the
* URLLoader class.</p>
*/
var XMLDocumentAway = /** @class */ (function (_super) {
__extends(XMLDocumentAway, _super);
/**
* Creates a new XMLDocument object.
* You must use the constructor to create an XMLDocument object
* before you call any of the methods of the XMLDocument class.
* Note: Use the createElement() and createTextNode() methods
* to add elements and text nodes to an XML document tree.
* @param source The XML text parsed to create the new XMLDocument object.
*/
function XMLDocumentAway(source) {
if (source === void 0) { source = null; }
return _super.call(this, XMLNodeType.DOCUMENT_TYPE_NODE, 'null') || this;
}
// for AVM1:
XMLDocumentAway.prototype.axCallPublicProperty = function (value1, value2) {
return null;
};
XMLDocumentAway.prototype.axGetPublicProperty = function (value) {
return null;
};
XMLDocumentAway.prototype.axSetPublicProperty = function (value, value2) {
return null;
};
/**
* Creates a new XMLNode object with the name specified in the parameter.
* The new node initially has no parent, no children, and no siblings.
* The method returns a reference to the newly created XMLNode object
* that represents the element. This method and the XMLDocument.createTextNode()
* method are the constructor methods for creating nodes for an XMLDocument object.
* @param name The tag name of the XMLDocument element being created.
* @return An XMLNode object.
* */
XMLDocumentAway.prototype.createElement = function (name) {
console.log('createElement not implemented yet in flash/XMLDocument');
return null;
};
/**
* Creates a new XML text node with the specified text. The new node initially has no parent,
* and text nodes cannot have children or siblings.
* This method returns a reference to the XMLDocument object that represents the new text node.
* This method and the XMLDocument.createElement() method are the constructor methods
* for creating nodes for an XMLDocument object.
* @param text The text used to create the new text node.
* @return An XMLNode object.
*/
XMLDocumentAway.prototype.createTextNode = function (text) {
console.log('createTextNode not implemented yet in flash/XMLDocument');
return null;
};
/**
* Parses the XML text specified in the value parameter
* and populates the specified XMLDocument object with the resulting XML tree.
* Any existing trees in the XMLDocument object are discarded.
* @param source The XML text to be parsed and passed to the specified XMLDocument object.
*/
XMLDocumentAway.prototype.parseXML = function (source) {
console.log('parseXML not implemented yet in flash/XMLDocument');
};
/**
* Returns a string representation of the XML object.
* @return A string representation of the XML object.
*/
XMLDocumentAway.prototype.toString = function () {
console.log('toString not implemented yet in flash/XMLDocument');
return '';
};
return XMLDocumentAway;
}(XMLNode));
export { XMLDocumentAway };