3 Replies Latest reply on Jun 28, 2009 3:01 PM by CF_Ali

    To open in new window

    madurai


      Can somebody help me to solve the below code issue - when user clicks on the "flash1.swf", I want to open in new window and play the media player?

      Right now below code plays at same place....

       

      =================================================================================

       

      <script language="JavaScript">
      function Player(whichone,cnt)
      {
       
      var idisplay = document.getElementById(whichone);

      if (idisplay.style.display ==  "none")
      {

        idisplay.style.display="block";
      }
      else
      {

        idisplay.style.display="none";
      }
      }
      </script>

      <a href="##" onclick="Player('Player1','temp1');" style="vertical-align:top;">flash1.swf</a>

       

      <div id="player1" style="display:none">
      <table>
        <tr>
      <td>
      <OBJECT ID="temp1" WIDTH="255" HEIGHT="250" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
        VIEWASTEXT  TYPE="application/x-mplayer2">
      <PARAM NAME="URL" VALUE="flash1.swf">
      <PARAM name="autostart" VALUE="false">
      <PARAM name="ShowControls" VALUE="true">
      <param name="ShowStatusBar" value="true">
      <PARAM name="ShowDisplay" VALUE="false">
      <EMBED TYPE="application/x-mplayer2" SRC="flash1.swf" NAME="MediaPlayer" WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="1" ShowDisplay="0" autostart="0"> </EMBED>
      </OBJECT>     
      </td>
      </tr>
      </table>
      </div>

        • 1. Re: To open in new window
          Dan Bracuk Level 5

          write a separate page, newpage.cfm that has the code to run the player.

           

          call it like this

          <a href="newpage.cfm" target = "_blank">text </a>

           

          add url variables as required.

          • 2. Re: To open in new window
            Dileep_NR Level 2

            Please try this

             

            <script language="javascript">
            function viewPopUp(arg1,arg2)
            {

            myWindow=window.open('file2.cfm','file2','width=400,height=400')

             

            }
            </script>

             

            <a href="##" onclick="viewPopUp('Player1','temp1')" style="vertical-align:top;">flash1.swf</a>

            • 3. Re: To open in new window
              CF_Ali

              Hi there,

              how about you use the new cfwindow tag? heres what you can do, ceate a cfwindow then pass on your javascript variable, and display the code in there. Now, note that cfwindow takes full html syntax. For example, an <html> tag down to end </html>. Ill how you an example:

              <cfwindow name="example" title="here is my video" modal="yes" initshow="false">

              <html>

              <head>

                   <script>

               

              </script>

                             <body>

                  

                   </body>

                 </cfwindow>

              and now initialize your content in the cfwindow, and make it dynamic with whatever you wanna display using javascript. Get creative

              please let me know if that helped

              Ali