ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE-generated dynamic XML file for Flash with SWFObject 2.0

June 06, 2008 11:59am

Subscribe [1]
  • #1 / Jun 06, 2008 11:59am

    Ryan M.

    1511 posts

    Moderator’s note: Moved to Howto.

    This question may be related to a resolved thread.

    I’ve fed a fair share of EE-generated XML files to Flash before, but I finally hit a wall on one and I can’t for the life of me figure out why this movie will only read a “real” (i.e. physical) XML file and not the one I’m outputting with EE.

    The only different things about this instance is I’m using SWFObject 2.0 (latest) and the Actionscript for the Flash is kept as an external .as file.

    We have a flash file, that I’m putting onto the page with SWFObject, like so:

    var flashvars = {};
     flashvars.xmlPath = "/_xml/home.xml";
    var params = {};
     params.play = "true";
     params.loop = "true";
     params.menu = "true";
     params.quality = "high";
     params.scale = "showall";
     params.wmode = "transparent";
     params.devicefont = "false";
     params.allowfullscreen = "false";
     params.allowscriptaccess = "always";
    var attributes = {};
     attributes.align = "middle";
     attributes.id = "index";
     attributes.name = "index";
    swfobject.embedSWF("index.swf", "flashSplash", "900", "503", "8.0.0", false, flashvars, params, attributes);

    The XML path we’re passing is to a hard-coded XML file (properly formed, I checked) that is in the “_xml” directory. This works perfectly.

    I made a new EE template called “home_xml” in my “site” template group, set the type to XML, and just copied all the data from the original file into it (baby steps, baby steps…). If I go to that EE XML page in a browser, it looks exactly like the hardcoded XML page they sent me. I then changed the flashvar to a number of different things, none of which worked:

    flashvars.xmlPath = "/site/home_xml/";
    flashvars.xmlPath = "{path=site/home_xml}";
    flashvars.xmlPath = "site/home_xml/";

    The flash will simply not pick up this XML path and use the data from it!

    I’m wondering if this may be a SWFObject 2 issue? Maybe I’m passing the variable wrong (though I don’t think so, as it works with a physical file). Or maybe I need to do something different with my EE XML file? I’m at a loss on this one.

  • #2 / Dec 15, 2008 12:37am

    stinhambo

    1268 posts

    Did you find an answer to this?

  • #3 / Dec 15, 2008 7:38pm

    Ryan M.

    1511 posts

    We must have got this to work because the site was launched and this was working. I don’t recall what we did. The working stuff is:

    var flashvars = false;
    var params = {
      flashvars: "xmlPath=site/home_xml",
        play: "true",
        loop: "true",
        menu: "true",
        quality: "high",
        scale: "showall",
        wmode: "transparent",
        devicefont: "false",
        allowfullscreen: "false",
        allowscriptaccess: "always"
      };
    var attributes = {
      align: "middle",
      id: "index"
      };
    
    swfobject.embedSWF("index.swf", "flashSplash", "900", "503", "8.0.0", false, flashvars, params, attributes);

    So maybe the path just had be that way:

    "xmlPath=site/home_xml"
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases