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

    I just did it before to find the same solution here rolleyes:

          $js = '<script type="text/javascript" defer="defer" >' . "\n"


    is absolutly needed, whatever other "base tag" solutions are, or not, applied.

    Version in reposirory is not updated yet. (!?)

      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don&#39;t pay attention
      http://www.dzi-neo.net
      • 8894
      • 114 Posts
      Quote from: dev_cw at Apr 23, 2008, 01:56 PM

      enidan: thanks for the new release, this is a handy snippet laugh
      Thank you smiley

      Quote from: elz64 at May 12, 2008, 08:33 AM

      Version in reposirory is not updated yet. (!?)
      Sorry to both of you, I had forgotten.
      It’s done now : new release 1.0.3
        • 29635
        • 361 Posts
        Not sure if anybody could use this, or if it’d be worth adding to this snippet, but PHP can detect the size of swf files. I’ve modified this snippet in two places to allow PHP to detect the height and width automatically.

        First, add a the code to get the dimensions on the snippet code:
        $dimensions = getimagesize($modx->config['base_path'] . $swfFile);
        if (!isset($objWidth)) {
        	$objWidth = $dimensions[0];
        }
        if (!isset($objHeight)) {
        	$objHeight = $dimensions[1];
        }
        return $soInstance->process(array('swfFile' => $swfFile,
        


        Then change it to not require objWidth and objHeight in swfobject.class.php:
            // Verify required parameters
            if (empty($config['swfFile']) || empty($config['flashVersion'])
            || empty($config['mode']) || empty($config['objId'])
            // || empty($config['objWidth']) || empty($config['objHeight'])
            ) {
              return FALSE;
            }


        Enidan, thanks SO much for contributing this. Makes dealing with swfs so much easier.
          Need MODx Ecommerce? Try FoxyCart!
          • 18551
          • 1 Posts
          Hi to everyone
          I am new to Modx, i am trying to use the SWFObject, but i am confused on how to.
          Is there a tutorial or a step-by-step document.
          I have already read the documentation

          here is the code i used it is not outputting anything.



          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
          "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
          <head>
          <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
          <meta name="description" content="_your description goes here_" />
          <meta name="keywords" content="_your,keywords,goes,here_" />
          <meta name="author" content="_your name goes here_ / Original design: Andreas Viklund - http://andreasviklund.com/" />
          <link rel="stylesheet" type="text/css" href="assets/templates/andreas03/style/andreas03.css" />
          <title>[(site_name)] | [*pagetitle*]</title>


          </head>
          <body>
          <div id="thetop">
          [!SWFObject? &mode=`static` &flashVersion=`7.0.0` &objId=`footer` &objWidth=`790` &objHeight=`150` &swfUrl=`assets\templates\Andreas03\images\header.swf`!]
          </div>
          <div id="container">
          <div id="main">
          <!--<div id="logo">
          <h1>[<a href="index.php" accesskey="4">[(site_name)]</a>]</h1>

          <span id="tagline">[*longtitle*]</span>
          </div>-->
          [*content*]
          </div>
          <div id="sidebar">
          <h2 class="sidelink menuheader"><a id="sitemenu"></a>Site menu:</h2>
          <div id="navigation">
          [[Wayfinder? &startId=`0` &level=`2`]]
          </div>
          <div class="clear">&nbsp;</div>
          </div>
          </div>
          <div id="footer"><p>&copy; 2005 [(site_name)].</p></div>
          </body>
          </html>
            • 8894
            • 114 Posts
            Quote from: maskebe at May 27, 2008, 09:45 AM

            Hi to everyone
            I am new to Modx, i am trying to use the SWFObject, but i am confused on how to.
            Is there a tutorial or a step-by-step document.
            I have already read the documentation

            here is the code i used it is not outputting anything.

            .....
            Hello and welcome to MODx community !

            I can’t try now your code (I will do later), but I noticed that you’re using the ID "footer" twice whereas it must be unique : once into SWFObject call and once at the end of the code. Maybe it wasn’t clear for you : SWFObject snippet will create an HTML tag which will have the ID you specified in &objId.

            Edit: OK, I found what you did wrong : simply change &swfUrl to &swfFile
            Duplicated IDs don’t seem to prevent the script working, but you should correct it.
              • 8894
              • 114 Posts
              New release 1.0.4 :
              &objWidth and &objHeight are now optional, thanks to Brett (The Man Can!) contribution !

              Quote from: The at May 25, 2008, 12:44 AM

              Not sure if anybody could use this, or if it’d be worth adding to this snippet, but PHP can detect the size of swf files. I’ve modified this snippet in two places to allow PHP to detect the height and width automatically.

              ....
              Thanks for this great contribution !
              However, I didn’t code it the same place you did, instead I changed setConfig() function in swfobject.class.php.
                • 25803 ☆ A M B ☆
                • 721 Posts
                I’ve got some extensive experience with snippets (a lot of eform and webloginPE work for example) but I can’t seem to figure out where I’ve gone wrong with this one.

                I am seeing the snippet call rendered rather than the flash movie (or alternate content).

                My call is:

                [!SWFObject?&altContent=`WorkflowHTML`&mode=`dynamic`&flashVersion=`9.0.0`&objId=`flashheader`&swfFile=`/assets/flash/workflow.swf`!]


                I’ve place the folder swfobject under assets/snippets on the server and created a Snippet called SWFObject with the applicable code.

                Example is here.

                Any suggestions?
                  • 7231
                  • 4,205 Posts
                  The first place to look when that happens is the cache settings. Try it with cached snippet tags [[SWFObject...]] or turn off the page cacheable settings.

                  Another place to look would be to make sure that you have the snippet spelled the same way as it is spelled in the snippet manager page, snippets are case sensitive.

                  These are the two top reasons why you would see the snippet call on the page.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 8894
                    • 114 Posts
                    Hello rx2,

                    I don’t know if you changed something since your post, but when I look to your site source code, it seems to me you’ve got 2 calls to SWFObject snippet:

                    • one into div "header", which is the one displaying on screen
                    • one into div "content", which works perfectly
                    Is it right ?

                    However, I tried the snippet call from div "header" and it works correctly with my configuration.
                      • 25803 ☆ A M B ☆
                      • 721 Posts
                      Hello and thank you.

                      Tried the cache/uncache, clean cache stuff, and the spelling as a matter of course for snippet calls not displaying but no dice. I put in the second call just to see if what I’m doing in the header is a factor, but it had the same behaviour before I put that in.

                      I removed it and set the call to uncached and it works in IE and Safari now (though I see the layout isn’t exact in Safari but that’s another matter), but no dice in Firefox 3. I’ll look into an issues with Firefox 3 though I can usually see Flash (and sometimes adblock can be aggressive).