1 Reply Latest reply on Dec 7, 2010 3:09 PM by Wasobi33

    Lightbox embedding with timer

    Wasobi33

      So I've got a video that is presently working on a page. The SWF is set to call another SWF as well as an FLV video based on a timer. I would like this video to play in a lightbox. I pulled the code to setup a lightbox from here: http://blog.codefidelity.com/?p=15 & http://blog.codefidelity.com/?p=18. I dumped in the code as I saw fit, either it is incorrect, or the lightbox script is unable to handle what I need. I'm thinking a bit of extra Javascript might take care of it? I was also thinking some code in the flash "button" may be able to be created to act as a timer. Any help at all is appreciated.

       

      The problem I am having is setting up the timer, presently the first video pulls up (rmk_player.swf), but is not calling upon the others. The video should pull up the rmk_player.swf, then the intro.swf, followed by the rmk_590.flv. This all works on the non-lightbox version.

       

      Here is my code that is working to play the video on the page:

      <script language="JavaScript" type="text/javascript" src="/_scripts/AC_RunActiveContent.js"></script>
          <script language="JavaScript" type="text/javascript" src="/_scripts/swfobject.js"></script>
          <script language="JavaScript" type="text/javascript" src="/_scripts/ui.js"></script>
          <script language="JavaScript" type="text/javascript">
              var requiredMajorVersion = 8;
              var requiredMinorVersion = 0;
              var requiredRevision = 24;
          </script>

                                   <script language="JavaScript" type="text/javascript">
                                      if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
                                          alert("This page requires AC_RunActiveContent.js.");
                                      } else {
                                          var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
                                          if(hasRightVersion) {
                                              AC_FL_RunContent(
                                                  'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
                                                  'width', '729',
                                                  'height', '551',
                                                  'src', 'rmk_player',
                                                  'quality', 'best',
                                                  'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                                                  'align', 'middle',
                                                  'play', 'true',
                                                  'loop', 'true',
                                                  'scale', 'showall',
                                                  'wmode', 'transparent',
                                                  'devicefont', 'false',
                                                  'id', 'rmk_player',
                                                  'bgcolor', '#ffffff',
                                                  'name', 'rmk_player',
                                                  'menu', 'false',
                                                  'allowScriptAccess','sameDomain',
                                                  'allowFullScreen','false',
                                                  'movie', 'rmk_player',
                                                  //play with intro and wait for user to press play
                                                  'flashvars','var1=name&var2=name@gmail.com&var3=800-495-6989&AutoPlay=true&intro_time=2&mktgtintro=swf/intro.swf',
                                                  'salign', ''
                                                  );
                                          } else {
                                              var alternateContent = 'This content requires the Adobe Flash Player. <a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
                                              document.write(alternateContent);
                                          }
                                      }
                                  </script>
                                  <noscript>
                                      <embed src="rmk_player.swf" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="transparent" devicefont="false" bgcolor="#ffffff" name="rmk_player" menu="false" allowscriptaccess="sameDomain" allowfullscreen="false" flashvars="var1=&amp;var2=&amp;var3=&amp;AutoPlay=true&intro_time=15&amp;mktgtintro=intro .swf" salign="" type="application/x-shockwave-flash" align="middle" height="551" width="729">
                                      This content requires the Adobe Flash Player. <a href="http://www.macromedia.com/go/getflash/">Get Flash</a>
                                  </noscript>
                                  <img src="/_assets/001/images/1px.gif" height="1" width="729" alt="" border="0">

       

       

      Here is the code I have with the lightbox version. There is a flash "button.swf" that is simply a place holder, which calls open the "rmk_player.swf".
          <script language="JavaScript" type="text/javascript" src="/_scripts/AC_RunActiveContent.js"></script>
          <script language="JavaScript" type="text/javascript" src="/_scripts/swfobject.js"></script>
          <script language="JavaScript" type="text/javascript" src="/_scripts/ui.js"></script>
          <script language="JavaScript" type="text/javascript">
              var requiredMajorVersion = 8;
              var requiredMinorVersion = 0;
              var requiredRevision = 24;
          </script>
              <script type="text/javascript">
          function SWFDelegate(url,width,height,caption) {
              var objLink = document.createElement('a');
              objLink.setAttribute('href',url);
              objLink.setAttribute('rel','lightbox');
              objLink.setAttribute('title',caption);
              if(typeof width != 'undefined') {
                  objLink.setAttribute('width',width);
              }
              if(typeof height != 'undefined') {
                  objLink.setAttribute('height',height);
              }
              Lightbox.prototype.start(objLink);
          }

       

          </script>
               <script language="JavaScript" type="text/javascript">
                                      if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
                                          alert("This page requires AC_RunActiveContent.js.");
                                      } else {
                                          var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
                                          if(hasRightVersion) {
                                              AC_FL_RunContent(
                                                  'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
                                                  'width', '729',
                                                  'height', '551',
                                                  'src', 'rmk_player',
                                                  'quality', 'best',
                                                  'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                                                  'align', 'middle',
                                                  'play', 'true',
                                                  'loop', 'true',
                                                  'scale', 'showall',
                                                  'wmode', 'transparent',
                                                  'devicefont', 'false',
                                                  'id', 'rmk_player',
                                                  'bgcolor', '#ffffff',
                                                  'name', 'rmk_player',
                                                  'menu', 'false',
                                                  'allowScriptAccess','sameDomain',
                                                  'allowFullScreen','false',
                                                  'movie', 'rmk_player',
                                                  //play with intro and wait for user to press play
                                                  'flashvars','var1=name&var2=name@gmail.com&var3=800-495-6989&AutoPlay=true&intro_time=2&mktgtintro=swf/intro.swf',
                                                  'salign', ''
                                                  );
                                          } else {
                                              var alternateContent = 'This content requires the Adobe Flash Player. <a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
                                              document.write(alternateContent);
                                          }
                                      }
                                  </script>
                                 
          <script src="js/prototype.js" type="text/javascript"></script>
          <script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
          <script src="js/lightbox++.js" type="text/javascript"></script>

       

       

       

          <style type="text/css">
              body{
                  color: #fff;
                  font: 13px 'Lucida Grande', Verdana, sans-serif;   
                  background-color: #101010;
                 
                  }
          </style>

       

      </head>
      <body>
      <table width="800" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td align="center">
              <br />
              <br />
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400">
                <param name="movie" value="button.swf">
                <param name="quality" value="high">
                <param name="wmode" value="transparent">
                <param name="allowscriptaccess" value="samedomain">
                <embed src="button.swf" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" devicefont="false" name="rmk_player" menu="false" allowscriptaccess="sameDomain" allowfullscreen="false" flashvars="var1=&amp;var2=&amp;var3=&amp;AutoPlay=true&intro_time=15&amp;mktgtintro=intro .swf" salign="" type="application/x-shockwave-flash" align="middle" height="551" width="729"> </embed>
              </object>
          </td>
        </tr>
      </table>
                <embed src="flv/RMK_590.flv" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed>

       

       

      Here is my code on my flash "button" that pulls up the lightbox:
      on(release) {
      getURL("javascript:SWFDelegate('swf/rmk_player.swf','800','600','RMK');");

       

      }