We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14066
    • 37 Posts
    Is it possible to use tags, like for example [*longtitle*], in a flash header? I want my title to appear automaticly in my flash header, but I haven’t found the solution for this yet.

    Can someone help me with this, if it’s even possible... smiley
      • 25483
      • 741 Posts
      You can pass variables to flash with swfobject (js script, can be found on google), then you can use those variables to show up in the flash file.
        with regards,

        Ronald Lokers
        'Front-end developer' @ h2o Media

        • 10449
        • 956 Posts
        yep. Something like this:

        <script type="text/javascript">
           var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
           so.addVariable("pagetitle", "[*pagetitle*]");
           so.write("flashcontent");
        </script>


        inside your FLA, you would just have to assign the pagetitle-var to your dynamic textfield.
        http://blog.deconcept.com/swfobject/

        Any other Flash-embedding technique would work too. You can also just append the var to the swf url:
        movie.swf?pagetitle=[*pagetitle*]


          • 14066
          • 37 Posts
          Nice! it’s working with the swf object!

          This is the first step...the next thing i did was trying to put my wayfinder menu & breadcrumb in the flash, but that isn’t working so far. It seems that the code [! -- !] or [[ --- ]] is not being accepted by javascript...

          I did this:

          <script type="text/javascript">
             var so = new SWFObject("assets/flash/Header.swf", "Header", "900", "250", "8", "#ffffff");
             so.addVariable("pagetitle", "[*pagetitle*]"); 
             so.addVariable("breadcrumb", "[[breadcrumbs]]");
             so.write("flashcontent");
          </script>


          Could there be a solution to this?
            • 25483
            • 741 Posts
            The best way to create a managable menu in flash is with a XML file. You have to generate a XML file with modx (you can change the file type of a modx document) that has the right wayfinder call. Then is flash you have to make a menu that can build itself with a xml feed that reads the xml file from modx.

            Don’t ask me how to do this... I have never done it myself before!
              with regards,

              Ronald Lokers
              'Front-end developer' @ h2o Media

              • 10449
              • 956 Posts
              PHP + MODx are case-sensitive. Hence,

                 so.addVariable("breadcrumb", "[[breadcrumbs]]");


              should probably be:

                 so.addVariable("breadcrumb", "[[Breadcrumbs]]");


              The Breadcrumbs snippet is not lowercase, at least not in 0.9.6.3 with the default install.

              But I agree, if you want to import entire HTML parts (menus, pages etc.), it’s probably safer to use XML with Ditto and custom template-chunks. If you expect HTML in a snippet output, make sure you use CDATA in your XML nodes.
              http://www.w3schools.com/XML/xml_cdata.asp

              btw, you can debug your Flash movie if you list all variables in the authoring environment. Perhaps there are special characters in the snippet output that cut off part of the variable (line-breaks, ", ’ = etc.).

              If you have lots of server-Flash interaction, maybe using something like AMFPHP is even better (and faster) than using XML: http://www.amfphp.org/
                • 14066
                • 37 Posts
                so.addVariable("breadcrumb", "[[Breadcrumbs]]");


                i know, already changed that but copied the old source smiley But i think your tight about the cutoff, i can’t think off another reason right now. Maybe i’ll get back to it later.

                Thnx for the help.