We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3515
    • 19 Posts
    Hi, everyone! It’s me again, and here is another trouble:

    History: I have to make flash site, wich manages via MODx.
    Solution: I has found information about how to make XML pages from MODx, then when I have preview page - it’s display correct XML. (Using DENWER - local PHP/MySQL server)
    Problem: In a flash action script I has wrote this:

    var myXML=new XML();
    myXML.load("http://my_modx_site.com/main.xml");
    


    Opening this address in browser is correctly displayed XML, which I want to have

    And I get an error message: Error opening URL ’http://my_modx_site.com/main.xml’. on the Flash debugger console

    As I understood, Flash can’t find phisical location of xml file. Have I write modulle to generate XML files? It will very sad, If I have, becouse it double work. MODx creates a correct XML document, but I need to generate this one more time to write it to a file for Flash can access this one...

    P.S.: Sorry for my english...
      • 11055 ☆ A M B ☆
      • 3,112 Posts
      I thought, the only flash CMS would be http://www.gaiaflashframework.com/ ?
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 36416
        • 589 Posts
        Quote from: Black at Aug 17, 2010, 05:50 AM

        And I get an error message: Error opening URL ’http://my_modx_site.com/main.xml’. on the Flash debugger console

        As I understood, Flash can’t find phisical location of xml file.

        Is the SWF file on the same domain?
        We need more information than "error opening URL" from Flash - try tracing relevant variable values at startup...
          • 3515
          • 19 Posts
          Is the SWF file on the same domain?

          Yes. I test the site via local server, so swf file in the same location, as whole site.

          try tracing relevant variable values at startup...

          I tried, but there’s no some special variables. I’ll explain.

          1. For Flash will not understand HTML tags as XML tags I created snippet HTML2XML_Converter:
          <?php
          include_once('manager/includes/config.inc.php');
          include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
          include_once('classes/docAPI.php');
          $modx = new DocumentParser;
          
          $doc=new Document($docId);
          $content=htmlentities($doc->get('content'));
          
          echo $content;
          ?>


          2. I created template with this content:
          <?xml version="1.0" encoding="UTF-8" ?>
          <root>
          <password>[*password*]</password>
          <pagetitle>[*pagetitle*]</pagetitle>
          <content>[!HTML2XML_Converter? &docId=`[*id*]`!]</content>
          </root>


          as a result I recieved this XML:
          <?xml version="1.0" encoding="UTF-8" ?>
          <root>
          <password><password/>
          <pagetitle>Главная страница</pagetitle>
          −
          <content>
          <h3>Install Successful!</h3>
          <p>You have successfully installed and configured MODx. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change out the template and add your own content and snippets, and you'll be good to go! </p>
          <h3>Getting Help</h3>
          <p>The <a href="http://modxcms.com/modx-team.html" target="_blank">team behind MODx</a> strives to contantly add to and refine the documentation to help you get up to speed with MODx:</p>
          <ul>
          <li>For basic instructions on integrating custom templates into MODx, please see the <a href="http://modxcms.com/designer-guide.html" target="_blank">Designer's Guide</a>. </li>
          <li>For an introduction to working in MODx from the content editors perspectve, see the <a href="http://modxcms.com/editor-guide.html" target="_blank">Content Editor's Guide</a>. </li>
          <li>For a detailed overview of the backend "manager" and setting up Users and Groups, please peruse the <a href="http://modxcms.com/developers-guide.html" target="_blank">Administration Guide</a>.</li>
          <li>For developers, architecture and API documentation can be found in the <a href="http://modxcms.com/administration-guide.html" target="_blank">Developer's Guide</a>.</li>
          <li>And if someone has installed this site for you, but you're curious as to the steps they went through, please see the <a href="http://modxcms.com/getting-started.html" target="_blank">Getting Started Guide</a>.</li>
          </ul>
          <p>And don't forget, you can always learn and ask questions at the <a href="http://www.modxcms.com/forums" target="_blank">MODx forums</a>.</p>
          </content>
          </root>
          


          3. I had changed content-type of whole pages to text/xml

          4. In flash action script (external file) I make this code:
          var myXML=new XML();
          myXML.load("http://my_modx_site.com/main.xml"); //main.xml - is a page with allias named "main" and suffix "xml"
          


          That’s where I recieved error message
            • 3515
            • 19 Posts
            <password> tag in XML-file is a TV (some section of gallery customer wants to close by a password)
              • 36416
              • 589 Posts
              Quote from: Black at Aug 17, 2010, 08:05 AM

              as a result I recieved this XML:
              (...)
              That’s where I recieved error message

              Hmm, isn’t that content supposed to be inside CDATA wrapper?
              http://www.kirupa.com/web/xml/XMLbasics6.htm
                • 3515
                • 19 Posts
                Quote from: Eol at Aug 17, 2010, 08:30 AM

                Quote from: Black at Aug 17, 2010, 08:05 AM

                as a result I recieved this XML:
                (...)
                That’s where I recieved error message

                Hmm, isn’t that content supposed to be inside CDATA wrapper?
                http://www.kirupa.com/web/xml/XMLbasics6.htm

                Will try! Thanks!))
                  • 3515
                  • 19 Posts
                  I tried. All works fine in modx, but this damn Flash error displayed again, so I can’t parse XML data...((( What’s interesting... - I was setup site settings to use friendly urls, when I write something like http://my_modx_site.com/main.xml in addressbar in browser, it works, but when I rightclick a document in modx manager and choose "preview" - in a new tab I see "http://my_modx_site.com/index.php?id=1’."

                  It was be funny, if not a sad - I was previewed an xml page in browser, saved into a root of site as xml-document, and Flash error disappeared, data has recieved by Flash...
                    • 3515
                    • 19 Posts
                    I found solution! Thanks for all for answers, but problem wasn’t becouse of modx or action scripts or something else bounded with code. Test server - this is a source of problem. Flash can connect xml that located in real url, not virtual. I tried to recieve data from the another site a had made - it’s works! YAHOO!!! (sorry for emotionality...). How can I mark this topic as ’solved’?

                    P.S.: For people, that interesting theme "how to connect modx with flash":
                    http://community.modx-cms.ru/blog/tips_and_tricks/753.html
                      • 36416
                      • 589 Posts
                      Quote from: Black at Aug 18, 2010, 04:08 AM

                      Test server - this is a source of problem. Flash can connect xml that located in real url, not virtual. I tried to recieve data from the another site a had made - it’s works!

                      Glad you got it solved - that’s why I asked "same domain" question at the start of our conversation.

                      Here’s another link for non-Russian speakers: http://kb2.adobe.com/cps/142/tn_14213.html