We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13736
    • 345 Posts
    Hi,

    I found a couple threads about feeding the MODx folder structure to a flash file so that shouldn’t be hard, but has anyone tried feeding full pages into a flash interface?

    I’m wanting to take a folder in the site and feed both it’s menus and page content into a flash program so that the text can be updated from MODx. Has this been done before or is MODx going to need some special upgrades?

    Currently I don’t need to do a whole site, just one folder with five pages. But I guess this would be easily scale-able once you get a small version working.
      • 13736
      • 345 Posts
      Anything?
        • 22303 MODX Staff
        • 10,725 Posts
        jbjones: This really just depends on how you are going to handle data on the Flash side. I’ve got several Flash applications that retrieve data from MODx documents with custom snippets designed to generate the XML data I’m expecting in the Flash. But in most cases, I believe you would need to generate a custom XML document or some other output format which you could make the best use of on the Flash side. I don’t think just getting the full HTML markup from a page is going to do you any good on the Flash side however.
          • 26435
          • 1,193 Posts
          ScottyDelicious Reply #4, 19 years ago
          How good are you with ActionScript?

          You could write a snippet to query the db for the content field of a particular document (query by id, pagetitle, alias, whatever....).

          I am not an ActionScript programmer, hell, I can barely swim in PHP, but perhaps something similar to this to get the content from the document with id 25?

          ActionScript:
          onClipEvent (load) {
            loadVariables("http://yourdomain.url/snippetpage.html?id=25", this, "GET");
          }
          


          And the snippet placed on the document with the alias "snippetpage" (should be a blank template with no other content):
          <?php
          	if (!$_GET['id'])
          	{
          		return;
          	}
          	
          	$documentID = $_GET['id'];
          	$site_content = $modx->getFullTableName('site_content');
          	$contentSQL = "SELECT `content` FROM ".$site_content." WHERE `id` = '".$documentID."'";
          	$contentQuery = $modx->db->query($contentSQL);
          	$limit = $modx->db->getRecordCount($contentQuery);
          	
          	if ($limit == 0 || $limit > 1)
          	{
          		return;
          	}
          	
          	$content = $modx->db->getRow($contentQuery);
          	return 'content='.$content;
          ?>
          


          I am hoping that you are more brushed up on your actionscript than I am for dynamically loading text, but that might get you started.

          -sD-
          Dr. Scotty Delicious, DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 6726
            • 7,075 Posts
            <off topic>
            Man, sorry but you made me go shocked and I couldn’t resist grin
            Do you think our favorite Pirate can barely swim in PHP ?
            </off topic>
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 13736
              • 345 Posts
              Thanks. That gets me on the right track.
                • 20044
                • 33 Posts
                I do import complete html pages into flash. I use a simple script that retrieves a document from the database (wordpress in this case). It translates the relevant html-markup (bold, italic, etc) to tags flash understands (em ->i, strong->b) and discards the rest. It also adresses some whitespace issues.
                This way the client can use (simple) markup using the wordpress manager.
                You can do this in modx using a plugin or snippet I guess.