Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Reading XML using expressions

  • Reading XML using expressions

    Posted by Frank Lima on June 13, 2012 at 1:04 am

    I’ve been trying to read in an XML using expressions. I saw in the forum that it IS possible, through this link: https://forums.creativecow.net/thread/227/20842

    However, when I implement the code, it gives me an error that says: class ‘global’ has no property named ‘myXmlFile’

    the code is here:

    var fileOK = myXmlFile.open("r");
    if (fileOK){
    var myXmlString = myXmlFile.read();
    var myRoot = new XML (myXmlString);
    myXmlFile.close();
    }

    I notice that there is an object named ‘myXmlFile’ now how do I create it? I know var fileOk is an object that does something with ‘myXmlFile’ but HOW do I create the var for myXmlFile? and what is “r” ? to read?

    Sorry, new to javascript. It’s so different from other languages.

    Frank Lima replied 14 years, 1 month ago 42,934 Members · 1 Reply
  • 1 Reply
  • Frank Lima

    June 13, 2012 at 1:35 am

    If I create the var such as:
    var myXmlFile = new File(testXMLPath);

    with:
    testXMLPath = “happy.xml”;

    It throws an error and says: “File does not have a constructor”

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy