We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4966
    • 143 Posts
    I have this working on a html page and I’ve been trying to get the code working in modX. Here is the code. It doesn’t find my flash. You will also see if flash is available I’m creating a new CSS rule. Finally I’m using MooTools in the html and testing if javascript is available if so I add a class for menu. As always any help would be appreciated.

    charlie-imac

    CODECODECODECODE

    <div id="wrap">
    <script type="text/javascript">
    //<![CDATA[
    var params = {
    allowScriptAccess: "always",
    wmode: "transparent" // need this to respect z-index
    }
    swfobject.embedSWF("http://localhost/marshaStaiger/marshadesign/marshaHome.swf", "home_flash", "100%", "100%", "9.0.0", "http://localhost/marshaStaiger/assets/js/swfobject/expressInstall.swf", null, params);
    if (swfobject.hasFlashPlayerVersion("9.0.0") === true)
    swfobject.createCSS("home_flash", "overflow:visible;z-index:22");


    $$(’#logo a’)[0].addClass(’home’);
    //]]>
    </script>
    </div>

    <script type="text/javascript">
    //<![CDATA[
    // if we have js, we can stylize the menu
    $(’menu’).addClass(’js_live’);

    //]]>
    </script>


    </body>
    </html>
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can use code tags (the octothorp or pound sign button in the forum editor’s toolbar) to encapsulate your code in forum posts.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4966
        • 143 Posts
        Anyone?
          • 29774
          • 386 Posts
          Are you viewing the page while logged into the manager and do you have the quickedit plugin activated? It could be a js conflict.
            Snippets: GoogleMap | FileDetails | Related Plugin: SSL
            • 4966
            • 143 Posts
            I’m not viewing the page while logged in. My flash is not being loaded and the js detection is not working.
              • 9130
              • 171 Posts
              Are you sure that mootools and swfobject javascript files are included properly on the page?
                • 4966
                • 143 Posts
                This is the entire template. I’m using v1.0 of modX.

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                <html>
                <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

                <title>[(site_name)] | [*pagetitle*]<</title>

                <meta name="author" content="marshaStaiger.com" />
                <meta name="description" content="famous works of art by Marsha Staiger" />

                <link rel="stylesheet" href="assets/templates/marshaStaiger/style.v15.css" type="text/css" media="screen" />
                <base href="[(site_url)]" />

                <script type="text/javascript" src="assets/js/moo12-swfo2-sifr439.js’></script>

                <script type="text/javascript" src="assets/js/menu.js’)></script>

                <script type="text/javascript" src="assets/snippets/swfFix/swffix.js"></script>
                <script type="text/javascript">
                SWFFix.embedSWF("assets/templates/marshaStaiger/marshaHome.swf", "home_flash", "100%", "100%", "9.0.0");
                if (swfobject.hasFlashPlayerVersion("9.0.0") === true)
                swfobject.createCSS("home_flash", "overflow:visible;z-index:22");
                $$(’#logo a’)[0].addClass(’home’);
                </script>

                <script type="text/javascript">
                //<![CDATA[
                // if we have js, we can stylize the menu
                $(’menu’).addClass(’js_live’);

                //]]>
                </script>


                </head>

                <body>

                <div id="logo_wrap">
                <div id="logo">a href="[(site_name)]</a></div>
                </div>

                <div id="menu">
                <div id="opts">
                [[Wayfinder? &startId=`0`]]
                <ul>

                <li id="nav01"><a href="/viewworks/">W Works</a></li>
                <li id="nav02"><a href="/events/">E Events</a></li>
                <li id="nav03"><a href="/news/">N News</a></li>
                <li id="nav04"><a href="/studio/">S Studio</a></li>
                <li id="nav05"><a href="/bio/">B Bio</a></li>
                <li id="nav06"><a href="/private/">P Private</a></li>
                <li id="nav07"><a href="/school/">S School</a></li>
                </ul>
                </div>
                </div>


                <div id="home_flash"><img src="http://localhost/marshaStaiger/assets/templates/marshaStaiger/home.png" alt="" /></div>
                <div id="wrap">
                [*content*]


                </body>
                </html>
                  • 9130
                  • 171 Posts
                  That was not my intention, what I meant was for you to open up firebug and see if the js files are actually loaded with the page.
                    • 4966
                    • 143 Posts
                    LOL, sorry. The only script loading is the swfFix.
                      • 29774
                      • 386 Posts
                      <script type="text/javascript" src="assets/js/menu.js’)></script>

                      That’s the problem right there
                        Snippets: GoogleMap | FileDetails | Related Plugin: SSL