Solved

QUESTION ABOUT FLASH VIDEO NOT WORKING INSIDE OF HTML

Posted on 2009-05-13
11
986 Views
Last Modified: 2012-05-06
I'm working on a proof-of-concept for a client, and used Flash CS4 and Dreamweaver 8 (8.0.2) to embed Flash (SWF) into the site code. The idea is to load the Flash with background scene image, and video as SWF (plays inside a picture frame of bedroom scene). Scene with video works using Dreamweaver preview in FF 3.0 browser, but not on web site (see source code below).

Basically, Flash CS4 published and exported the HTML and SWF files, and I've included the JavaScript from the Flash export into my "flash_intro.html" page in the desired location of the page (inside a TD tag), not a separate JS script file -- no such file generated by Flash CS4. Also, not using "<object> or "embed" tags, and the SWF and FLV files are on the server and stored in the same directory as the HTML, so I assume this should work as expected.

I'm just starting out with Flash CS4 (trial version), but the process seems fairly intuitive at this point. Just seem to have something in the source code not configured correctly. Perhaps someone with a fresh set of eyes (and expertise) would have some suggestions or a solution? The web page in question can be found at http://www.m-ergentsolutions.com/bedzak/flash_intro.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Welcome to BedZak.com! Hidden Pockets For Your Bed!</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<style type="text/css">

<!--

.main_body_txt {color: #000000}
 

.footer{

	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; font-weight:normal; text-decoration:none; 

}
 

.footerlinks{

	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFCC33; font-weight:normal; text-decoration:none; 

}

.footerlinks:hover{

	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; font-weight:normal; text-decoration:none; 

}
 

.prod_price {

	font-size: 16px;

	color: #CC0000;

}

.header_links {

	font-size: 12px;

	color: #FFCC33;

}

body {

	background-image: url(images/marble_bg.jpg);

	background-repeat: repeat;

	margin-left: 0px;

}

a:link {

	color: #FFCC33;

	text-decoration: none;

}

a:hover {

	color: #;

	text-decoration: underline;

}

a {

	font-size: 12px;

}

a:visited {

	color: #;

	text-decoration: none;

}

a:active {

	color: #;

	text-decoration: none;

}

.style1 {font-size: 10px}
 

#Layer1 {

	position:absolute;

	width:250px;

	height:188px;

	z-index:1;

	left: 620px;

	top: 115px;

}

-->

</style>

</head>

<body bgcolor="#ffffff">

<!--url's used in the movie-->

<!--text used in the movie-->

</head>
 

<body onload="MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');">

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td align="left" valign="top"><table width="800" border="0" cellspacing="0" cellpadding="0">

      <tr bgcolor="#FFFFFF">

        <td height="85" colspan="2" align="left" valign="top" bgcolor="#FFFFFF" style="background-repeat:repeat-x; background-position:bottom left; padding-left:1px;"><div align="left"><img src="images/bedzak_home_top.jpg" width="800" height="100" /></div></td>

      </tr>

      <tr bgcolor="#DDCFB4">

        <td colspan="2" align="left" valign="top" bgcolor="#FFFFFF" style="background-repeat:repeat-x; background-position:bottom left; padding-left:1px;"><table width="800" border="0" cellspacing="0" cellpadding="0">

          <tr bgcolor="#663300">

            <td bgcolor="#482C29"><table width="100%" border="0" cellspacing="0" cellpadding="0">

             

			 </table>

			  <table width="100%" height="32" border="0" cellpadding="0" cellspacing="0">

                <tr bgcolor="#482C29">

                  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <tr align="center">

                      <td width="54" height="32" valign="middle"><a href="#" class="header_links">HOME</a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="62" valign="middle"><a href="http://www.bedzak.com/Read_more_about_our_products_s/4.htm" class="header_links">ABOUT  </a><a href="#"></a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="67" valign="middle"><a href="http://www.bedzak.com/category_s/3.htm" class="header_links">PRODUCTS</a><a href="#"></a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="55" valign="middle"><a href="http://www.bedzak.com/kb_results.asp" class="header_links">F.A.Q</a><a href="#"></a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="86" valign="middle"><a href="http://www.bedzak.com/register.asp" class="header_links">LOG IN </a><a href="#"></a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="65" valign="middle"><a href="http://www.bedzak.com/help.asp" class="header_links">SUPPORT</a></td>

                      <td width="4" valign="middle"><img width="4" height="13" /></td>

                      <td width="80" valign="middle"><a href="http://www.bedzak.com/aboutus.asp" class="header_links">CONTACT</a><a href="#"></a></td>

                    </tr>

                    </table></td>

                </tr>

                </table></td>

            </tr>

          <tr>

            <td>

<script language="JavaScript" type="text/javascript">

<!--

//v1.7

// Flash Player Version Detection

// Detect Client Browser type

// Copyright 2005-2008 Adobe Systems Incorporated.  All rights reserved.

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()

{

	var version;

	var axo;

	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {

		// version will be set for 7.X or greater players

		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");

		version = axo.GetVariable("$version");

	} catch (e) {

	}

	if (!version)

	{

		try {

			// version will be set for 6.X players only

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");

			

			// installed player is some revision of 6.0

			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,

			// so we have to be careful. 

			

			// default to the first public version

			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		

			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater

			version = axo.GetVariable("$version");

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 4.X or 5.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");

			version = axo.GetVariable("$version");

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 3.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");

			version = "WIN 3,0,18,0";

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 2.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");

			version = "WIN 2,0,0,11";

		} catch (e) {

			version = -1;

		}

	}

	

	return version;

}

// JavaScript helper required to detect Flash Player PlugIn version information

function GetSwfVer(){

	// NS/Opera version >= 3 check for Flash plugin in plugin array

	var flashVer = -1;

	

	if (navigator.plugins != null && navigator.plugins.length > 0) {

		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {

			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";

			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;

			var descArray = flashDescription.split(" ");

			var tempArrayMajor = descArray[2].split(".");			

			var versionMajor = tempArrayMajor[0];

			var versionMinor = tempArrayMajor[1];

			var versionRevision = descArray[3];

			if (versionRevision == "") {

				versionRevision = descArray[4];

			}

			if (versionRevision[0] == "d") {

				versionRevision = versionRevision.substring(1);

			} else if (versionRevision[0] == "r") {

				versionRevision = versionRevision.substring(1);

				if (versionRevision.indexOf("d") > 0) {

					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));

				}

			}

			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;

		}

	}

	// MSN/WebTV 2.6 supports Flash 4

	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;

	// WebTV 2.5 supports Flash 3

	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;

	// older WebTV supports Flash 2

	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;

	else if ( isIE && isWin && !isOpera ) {

		flashVer = ControlVersion();

	}	

	return flashVer;

}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available

function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)

{

	versionStr = GetSwfVer();

	if (versionStr == -1 ) {

		return false;

	} else if (versionStr != 0) {

		if(isIE && isWin && !isOpera) {

			// Given "WIN 2,0,0,11"

			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]

			tempString        = tempArray[1];			// "2,0,0,11"

			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']

		} else {

			versionArray      = versionStr.split(".");

		}

		var versionMajor      = versionArray[0];

		var versionMinor      = versionArray[1];

		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor

		if (versionMajor > parseFloat(reqMajorVer)) {

			return true;

		} else if (versionMajor == parseFloat(reqMajorVer)) {

			if (versionMinor > parseFloat(reqMinorVer))

				return true;

			else if (versionMinor == parseFloat(reqMinorVer)) {

				if (versionRevision >= parseFloat(reqRevision))

					return true;

			}

		}

		return false;

	}

}

function AC_AddExtension(src, ext)

{

  if (src.indexOf('?') != -1)

    return src.replace(/\?/, ext+'?'); 

  else

    return src + ext;

}

function AC_Generateobj(objAttrs, params, embedAttrs) 

{ 

  var str = '';

  if (isIE && isWin && !isOpera)

  {

    str += '<object ';

    for (var i in objAttrs)

    {

      str += i + '="' + objAttrs[i] + '" ';

    }

    str += '>';

    for (var i in params)

    {

      str += '<param name="' + i + '" value="' + params[i] + '" /> ';

    }

    str += '</object>';

  }

  else

  {

    str += '<embed ';

    for (var i in embedAttrs)

    {

      str += i + '="' + embedAttrs[i] + '" ';

    }

    str += '> </embed>';

  }

  document.write(str);

}

function AC_FL_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

     , "application/x-shockwave-flash"

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

function AC_SW_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"

     , null

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){

  var ret = new Object();

  ret.embedAttrs = new Object();

  ret.params = new Object();

  ret.objAttrs = new Object();

  for (var i=0; i < args.length; i=i+2){

    var currArg = args[i].toLowerCase();    

    switch (currArg){	

      case "classid":

        break;

      case "pluginspage":

        ret.embedAttrs[args[i]] = args[i+1];

        break;

      case "src":

      case "movie":	

        args[i+1] = AC_AddExtension(args[i+1], ext);

        ret.embedAttrs["src"] = args[i+1];

        ret.params[srcParamName] = args[i+1];

        break;

      case "onafterupdate":

      case "onbeforeupdate":

      case "onblur":

      case "oncellchange":

      case "onclick":

      case "ondblclick":

      case "ondrag":

      case "ondragend":

      case "ondragenter":

      case "ondragleave":

      case "ondragover":

      case "ondrop":

      case "onfinish":

      case "onfocus":

      case "onhelp":

      case "onmousedown":

      case "onmouseup":

      case "onmouseover":

      case "onmousemove":

      case "onmouseout":

      case "onkeypress":

      case "onkeydown":

      case "onkeyup":

      case "onload":

      case "onlosecapture":

      case "onpropertychange":

      case "onreadystatechange":

      case "onrowsdelete":

      case "onrowenter":

      case "onrowexit":

      case "onrowsinserted":

      case "onstart":

      case "onscroll":

      case "onbeforeeditfocus":

      case "onactivate":

      case "onbeforedeactivate":

      case "ondeactivate":

      case "type":

      case "codebase":

      case "id":

        ret.objAttrs[args[i]] = args[i+1];

        break;

      case "width":

      case "height":

      case "align":

      case "vspace": 

      case "hspace":

      case "class":

      case "title":

      case "accesskey":

      case "name":

      case "tabindex":

        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];

        break;

      default:

        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];

    }

  }

  ret.objAttrs["classid"] = classid;

  if (mimeType) ret.embedAttrs["type"] = mimeType;

  return ret;

}

// -->

</script>

<script language="JavaScript" type="text/javascript">

<!--

// -----------------------------------------------------------------------------

// Globals

// Major version of Flash required

var requiredMajorVersion = 9;

// Minor version of Flash required

var requiredMinorVersion = 0;

// Revision of Flash required

var requiredRevision = 124;

// -----------------------------------------------------------------------------

// -->

</script>

</head>

<body bgcolor="#ffffff">

<!--url's used in the movie-->

<!--text used in the movie-->

<script language="JavaScript" type="text/javascript">

<!--

var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if(hasRightVersion) {  // if we've detected an acceptable version

	// embed the flash movie

	AC_FL_RunContent(

		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0',

		'width', '800',

		'height', '535',

		'src', 'bedzak_scene_vid',

		'quality', 'high',

		'pluginspage', 'http://www.adobe.com/go/getflashplayer',

		'align', 'middle',

		'play', 'true',

		'loop', 'false',

		'scale', 'showall',

		'wmode', 'window',

		'devicefont', 'false',

		'id', 'bedzak_scene_vid',

		'bgcolor', '#ffffff',

		'name', 'bedzak_scene_vid',

		'menu', 'true',

		'allowFullScreen', 'false',

		'allowScriptAccess','sameDomain',

		'movie', 'bedzak_scene_vid',

		'salign', ''

		); //end AC code

} else {  // flash is too old or we can't detect the plugin

	var alternateContent = 'Alternate HTML content should be placed here.'

		+ 'This content requires the Adobe Flash Player.'

		+ '<a href="http://www.adobe.com/go/getflashplayer/">Get Flash</a>';

	document.write(alternateContent);  // insert non-flash content

}

// -->

</script>

<noscript>

	<img src="images/bedzak_bedroom_promo_vid.jpg" />

	<p>This content requires the Adobe Flash Player.

  	<a href="http://www.adobe.com/go/getflashplayer/">Get Flash</a><p>

</noscript>

</td>

            </tr>

        </table></td>

      </tr>

      <tr bgcolor="#DDCFB4">

        <td align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0">

          <tr>

            <td colspan="3"><div align="center">

              <p class="main_body_txt">Welcome to BedZak.com! Hidden Pocket Caddy for Your Bed!</p>

              </div></td>

            </tr>

          <tr>

            <td><div align="center"><a href="http://www.bedzak.com/ShoppingCart.asp?ProductCode=BPC-001&amp;CartID=1"><img src="images/bedzak_cafe_sm.jpg" alt="Bed Zak in Cafe color option" width="125" height="125" border="0" /></a></div></td>

            <td><div align="center"><a href="http://www.bedzak.com/ShoppingCart.asp?ProductCode=BPV-001&amp;CartID=2"><img src="images/bedzak_vanilla_sm.jpg" alt="Bed Zak in Vanilla color option" width="125" height="125" border="0" /></a></div></td>

          </tr>

          <tr>

            <td><div align="center">BED ZAK (CAFE)</div></td>

            <td><div align="center">BED ZAK (VANILLA)</div></td>

            </tr>

          <tr>

            <td><div align="center">

             <span class="prod_price">$29.95</span> + S/H </p>

              </div></td>

            <td><div align="center"><span class="prod_price">$29.95</span> + S/H </div></td>

            </tr>

          <tr>

            <td><div align="center"><a href="http://www.bedzak.com/ShoppingCart.asp?ProductCode=BPC-001&amp;CartID=1"><img src="images/buynow-red.gif" alt="Buy Now!" width="117" height="24" border="0" /></a></div></td>

            <td><div align="center"><a href="http://www.bedzak.com/ShoppingCart.asp?ProductCode=BPV-001&amp;CartID=2"><img src="images/buynow-red.gif" alt="Buy Now!" width="117" height="24" border="0" /></a></div></td>

            </tr>

          <tr>

            <td><div align="center"></div></td>

            <td><div align="center"></div></td>

            </tr>

        </table>

          <table width="100%" border="0" align="center">

            <tr>

              <td colspan="2"><div align="center">BED ZAK MAKES A GREAT GIFT IDEA FOR ANY OCCASSION!</div></td>

            </tr>

            <tr>

              <td><div align="center"><img src="images/mothersday.jpg" width="200" height="100" /></div></td>

              <td><div align="center"><img src="images/birthday.jpg" width="200" height="100" /></div></td>

            </tr>

          </table>          <p align="center" class="main_body_txt">&nbsp;</p>          </td>

        <td width="400" align="left" valign="top" bgcolor="#FFFFFF"><p class="main_body_txt">Add product details, features, promotional text and graphics here...</p>

          <ul>

            <li>Made from high-quality materials </li>

            <li>Easy-to-reach pockets</li>

            <li>Handy for clearing clutter off your nightstand! </li>

            <li>Store devices such as TV remotes, reading glasses, and medicine within easy reach!</li>

            </ul>

          <p align="center">What customers are saying about  Bed Zak:</p>

          <p align="center"><em>&quot;I really love my BedZak.&nbsp; I love to read so I now have a place to put  my book.&nbsp; I am pregnant, I do not have to bend over to reach my stuff.&nbsp;  I have a few crackers located in an easy reach pocket.&quot;&nbsp; </em><br />

            Britney M - Salt Lake City, UT</p>

          <p align="center"><em>&quot;We are enjoying the bed pockets, it is a great product, we were  constantly losing the remote control for our TV before we got it.&quot;</em> John M - Lowell, MA </p>

          <p>&nbsp;</p>

          <p>&nbsp; </p></td>

      </tr>

    </table>

      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

        <tr>

          <td bgcolor="#ffffff" style="background-repeat:repeat-x; background-position:bottom left;">&nbsp;</td>

        </tr>

      </table>

      <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>

          <td height="71" align="center" valign="middle" bgcolor="#482C29"><table width="600" border="0" cellspacing="0" cellpadding="0">

            <tr class="footerlinks">

              <td height="21" align="center" valign="top" class="footerlinks"><a href="#" class="footerlinks">Home</a>  &nbsp;&nbsp; : &nbsp;&nbsp;   <a href="http://www.bedzak.com/Read_more_about_our_products_s/4.htm" class="footerlinks">About Us </a>   &nbsp;&nbsp; : &nbsp;&nbsp;  <a href="http://www.bedzak.com/category_s/3.htm" class="footerlinks">Products</a>   &nbsp;&nbsp; : &nbsp;&nbsp;    <a href="http://www.bedzak.com/kb_results.asp" class="footerlinks">F.A.Q.</a>   &nbsp;&nbsp; : &nbsp;&nbsp;   <a href="http://www.bedzak.com/register.asp" class="footerlinks">My Account </a>   &nbsp;&nbsp; :&nbsp;&nbsp;    <a href="http://www.bedzak.com/help.asp" class="footerlinks">Support</a>   &nbsp;&nbsp; : &nbsp;&nbsp;   <a href="http://www.bedzak.com/aboutus.asp" class="footerlinks">Contact Us</a></td>

            </tr>

            <tr>

              <td align="center" valign="top" class="footer">Copyright &copy; 2009 Bed Pocket Inc. All Rights Reserved.</td>

            </tr>

          </table></td>

        </tr>

      </table></td>

  </tr>

</table>

</body>

</html>

Open in new window

0
Comment
Question by:mergent
  • 5
  • 5
11 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24379120
Hi mergent,

The javascript doesn't look quite right and Firebug reports a bunch of errors in the page.  You may want to pull out all of the Flash generated stuff and re-embed via Dreamweaver.

>> and the SWF and FLV files

I don't see a mention of an .flv when loading the page via Firebug...just swf. Also, I should be able to go directly to the Flash:


http://www.m-ergentsolutions.com/bedzak/bedzak_scene_vid.swf
and/or
http://www.m-ergentsolutions.com/bedzak/ClearOverAll.swf

and I can't.  Is this a Windows server?
0
 

Author Comment

by:mergent
ID: 24379260
Hello Jason! I've also created a second file for review with simply inserting the SWF file into the page body. See http://www.m-ergentsolutions.com/bedzak/flash_intro2.html.

Same issue with Flash video player not loading inside the picture frame. Works locally when previewing from Dreamweaver and FF browser, but not on web site for some reason. I need to load the SWF in the body so the video plays inside the bedroom scene -- only way w/o layers which won't appear correctly in different screen resolutions.

The server running the site through our web host is Linux, not Windows IIS.

Thanks for the help!

Chad
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24379314
Chad,

Something is different because when I now browser directly to the SWFs, they show up.  On the pages, I see the background of the bedroom (bedzak_scene_vid.swf) but no player or player controls pop up.

The ClearOverAll.swf may not like bedzak_scene_vid.swf as input.  Can you export bedzak_scene_vid.swf as a FLV and try to re-embed it?
0
 

Author Comment

by:mergent
ID: 24379408
Jason:

The FLA file I created used the background scene and FLV video player skin. Does Flash CS4 have this capability that you know of? I cannot export as a FLV from what I've seen. I do have SWiSH Video for video conversion -- used program to convert the MOV file to both a SWF and FLV for comparison purposes.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24379643
>> Does Flash CS4 have this capability that you know of?

I don't know.  My experience with player skin swf files is that they don't like other swf files but since you're running a custom job I have no idea where/what you've done differently.  

>> I do have SWiSH Video for video conversion

Okay.   That works, as does WinFF.  

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:mergent
ID: 24379746
My research also states Active Content javascript file (AC_RunActiveContent.js) should be uploaded to the server, but neither Dreamweaver or Flash CS4 exported any JS file that I can locate on the project folder. However, Flash CS4 created an HTML file with JS embedded...see below.  I've tried both methods with same result -- video player not showing in picture frame, not anywhere on the scene.
<script language="JavaScript" type="text/javascript">

<!--

//v1.7

// Flash Player Version Detection

// Detect Client Browser type

// Copyright 2005-2008 Adobe Systems Incorporated.  All rights reserved.

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;

var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()

{

	var version;

	var axo;

	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {

		// version will be set for 7.X or greater players

		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");

		version = axo.GetVariable("$version");

	} catch (e) {

	}

	if (!version)

	{

		try {

			// version will be set for 6.X players only

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");

			

			// installed player is some revision of 6.0

			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,

			// so we have to be careful. 

			

			// default to the first public version

			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		

			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater

			version = axo.GetVariable("$version");

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 4.X or 5.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");

			version = axo.GetVariable("$version");

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 3.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");

			version = "WIN 3,0,18,0";

		} catch (e) {

		}

	}

	if (!version)

	{

		try {

			// version will be set for 2.X player

			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");

			version = "WIN 2,0,0,11";

		} catch (e) {

			version = -1;

		}

	}

	

	return version;

}

// JavaScript helper required to detect Flash Player PlugIn version information

function GetSwfVer(){

	// NS/Opera version >= 3 check for Flash plugin in plugin array

	var flashVer = -1;

	

	if (navigator.plugins != null && navigator.plugins.length > 0) {

		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {

			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";

			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;

			var descArray = flashDescription.split(" ");

			var tempArrayMajor = descArray[2].split(".");			

			var versionMajor = tempArrayMajor[0];

			var versionMinor = tempArrayMajor[1];

			var versionRevision = descArray[3];

			if (versionRevision == "") {

				versionRevision = descArray[4];

			}

			if (versionRevision[0] == "d") {

				versionRevision = versionRevision.substring(1);

			} else if (versionRevision[0] == "r") {

				versionRevision = versionRevision.substring(1);

				if (versionRevision.indexOf("d") > 0) {

					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));

				}

			}

			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;

		}

	}

	// MSN/WebTV 2.6 supports Flash 4

	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;

	// WebTV 2.5 supports Flash 3

	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;

	// older WebTV supports Flash 2

	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;

	else if ( isIE && isWin && !isOpera ) {

		flashVer = ControlVersion();

	}	

	return flashVer;

}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available

function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)

{

	versionStr = GetSwfVer();

	if (versionStr == -1 ) {

		return false;

	} else if (versionStr != 0) {

		if(isIE && isWin && !isOpera) {

			// Given "WIN 2,0,0,11"

			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]

			tempString        = tempArray[1];			// "2,0,0,11"

			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']

		} else {

			versionArray      = versionStr.split(".");

		}

		var versionMajor      = versionArray[0];

		var versionMinor      = versionArray[1];

		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor

		if (versionMajor > parseFloat(reqMajorVer)) {

			return true;

		} else if (versionMajor == parseFloat(reqMajorVer)) {

			if (versionMinor > parseFloat(reqMinorVer))

				return true;

			else if (versionMinor == parseFloat(reqMinorVer)) {

				if (versionRevision >= parseFloat(reqRevision))

					return true;

			}

		}

		return false;

	}

}

function AC_AddExtension(src, ext)

{

  if (src.indexOf('?') != -1)

    return src.replace(/\?/, ext+'?'); 

  else

    return src + ext;

}

function AC_Generateobj(objAttrs, params, embedAttrs) 

{ 

  var str = '';

  if (isIE && isWin && !isOpera)

  {

    str += '<object ';

    for (var i in objAttrs)

    {

      str += i + '="' + objAttrs[i] + '" ';

    }

    str += '>';

    for (var i in params)

    {

      str += '<param name="' + i + '" value="' + params[i] + '" /> ';

    }

    str += '</object>';

  }

  else

  {

    str += '<embed ';

    for (var i in embedAttrs)

    {

      str += i + '="' + embedAttrs[i] + '" ';

    }

    str += '> </embed>';

  }

  document.write(str);

}

function AC_FL_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

     , "application/x-shockwave-flash"

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

function AC_SW_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"

     , null

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){

  var ret = new Object();

  ret.embedAttrs = new Object();

  ret.params = new Object();

  ret.objAttrs = new Object();

  for (var i=0; i < args.length; i=i+2){

    var currArg = args[i].toLowerCase();    

    switch (currArg){	

      case "classid":

        break;

      case "pluginspage":

        ret.embedAttrs[args[i]] = args[i+1];

        break;

      case "src":

      case "movie":	

        args[i+1] = AC_AddExtension(args[i+1], ext);

        ret.embedAttrs["src"] = args[i+1];

        ret.params[srcParamName] = args[i+1];

        break;

      case "onafterupdate":

      case "onbeforeupdate":

      case "onblur":

      case "oncellchange":

      case "onclick":

      case "ondblclick":

      case "ondrag":

      case "ondragend":

      case "ondragenter":

      case "ondragleave":

      case "ondragover":

      case "ondrop":

      case "onfinish":

      case "onfocus":

      case "onhelp":

      case "onmousedown":

      case "onmouseup":

      case "onmouseover":

      case "onmousemove":

      case "onmouseout":

      case "onkeypress":

      case "onkeydown":

      case "onkeyup":

      case "onload":

      case "onlosecapture":

      case "onpropertychange":

      case "onreadystatechange":

      case "onrowsdelete":

      case "onrowenter":

      case "onrowexit":

      case "onrowsinserted":

      case "onstart":

      case "onscroll":

      case "onbeforeeditfocus":

      case "onactivate":

      case "onbeforedeactivate":

      case "ondeactivate":

      case "type":

      case "codebase":

      case "id":

        ret.objAttrs[args[i]] = args[i+1];

        break;

      case "width":

      case "height":

      case "align":

      case "vspace": 

      case "hspace":

      case "class":

      case "title":

      case "accesskey":

      case "name":

      case "tabindex":

        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];

        break;

      default:

        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];

    }

  }

  ret.objAttrs["classid"] = classid;

  if (mimeType) ret.embedAttrs["type"] = mimeType;

  return ret;

}

// -->

</script>

<script language="JavaScript" type="text/javascript">

<!--

// -----------------------------------------------------------------------------

// Globals

// Major version of Flash required

var requiredMajorVersion = 9;

// Minor version of Flash required

var requiredMinorVersion = 0;

// Revision of Flash required

var requiredRevision = 124;

// -----------------------------------------------------------------------------

// -->

</script>

</head>

<body bgcolor="#ffffff">

<!--url's used in the movie-->

<!--text used in the movie-->

<script language="JavaScript" type="text/javascript">

<!--

var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if(hasRightVersion) {  // if we've detected an acceptable version

	// embed the flash movie

	AC_FL_RunContent(

		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0',

		'width', '800',

		'height', '535',

		'src', 'bedzak_scene_vid',

		'quality', 'high',

		'pluginspage', 'http://www.adobe.com/go/getflashplayer',

		'align', 'middle',

		'play', 'true',

		'loop', 'false',

		'scale', 'showall',

		'wmode', 'window',

		'devicefont', 'false',

		'id', 'bedzak_scene_vid',

		'bgcolor', '#ffffff',

		'name', 'bedzak_scene_vid',

		'menu', 'true',

		'allowFullScreen', 'false',

		'allowScriptAccess','sameDomain',

		'movie', 'bedzak_scene_vid',

		'salign', ''

		); //end AC code

} else {  // flash is too old or we can't detect the plugin

	var alternateContent = 'Alternate HTML content should be placed here.'

		+ 'This content requires the Adobe Flash Player.'

		+ '<a href="http://www.adobe.com/go/getflashplayer/">Get Flash</a>';

	document.write(alternateContent);  // insert non-flash content

}

// -->

</script>

<noscript>

	// Provide alternate content for browsers that do not support scripting

	// or for those that have scripting disabled.

  	Alternate HTML content should be placed here. This content requires the Adobe Flash Player.

  	<a href="http://www.adobe.com/go/getflashplayer/">Get Flash</a>

</noscript>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 24379771
>> My research also states Active Content javascript file (AC_RunActiveContent.js) should be uploaded to the server,
>> but neither Dreamweaver or Flash CS4 exported any JS file that I can locate on the project folder.

In DW 8.02 you have to enable that option:

Edit | Preferences | Code Rewriting | Active Content: Insert Using Browser Safe Scripts

The JS above is the same thing (possibly).  I'd have to do a line by line comparison.

To reiterate:  I don't think the embedding code is the issue at the moment.  I think your player swf is not good.
0
 

Author Comment

by:mergent
ID: 24379808
Must be the player SWF then. I'll adjust the DW preferences as recommended. I've even created a new page with just the FLVPlayer_Progressive.swf...plays the video and a basic controller skin from DW without issues. See http://www.m-ergentsolutions.com/bedzak/flash_intro3.html

Any suggestions to get the player working inside the picture frame?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 100 total points
ID: 24379829
Yup, almost has to be the player swf if you can do a plain vanilla player like that.  Sorry, but I actually don't work with Flash directly...I'm just an end user.

I would consider deleting this question and posting a new version that focuses on Flash alone.  DW isn't the issue.
0
 

Author Comment

by:mergent
ID: 24379902
Will do! I appreciate your time Jason!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now