Jump to content

swf file wont play


ppiper

Recommended Posts

Hi here is code for my page,

<!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=utf-8" />

<title>Page Peel sueandco</title>

<script type="text/javascript">

 

function maximizeFlash() {

a = document.getElementById('theFlash');

a.style.width = '600px';

a.style.height = '600px';

}

function minimizeFlash() {

a = document.getElementById('theFlash');

a.style.width = '170px';

a.style.height = '170px';

}

 

</script>

<script src="Logic/AC_RunActiveContent.js" type="text/javascript"></script>

<style type="text/css">

<!--

body {

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

background-image: url(bg.gif);

}

div {

}

body,td,th {

font-family: Arial, Helvetica, sans-serif;

font-weight: bold;

}

-->

</style></head>

 

<body>

<div style="width:100%; height:auto; text-align:center" align="center">

<div style="width:95%; text-align:left;" align="center">

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi dignissim. Duis

 

</div>

<div id="theFlash" style="width:170px; height:170px; z-index:65535; text-align:right; position:absolute; top:0px; right:0px;">

  <script type="text/javascript">

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','100%','height','100%','src','pagepeel01','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','allowscriptaccess','always','wmode','transparent','movie','pagepeel01' ); //end AC code

</script><noscript><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="100%" height="100%">

    <param name="movie" value="pagepeel01.swf" />

    <param name="quality" value="high" />

    <param name="allowScriptAccess" value="always" />

    <param name="wmode" value="transparent" />

    <embed src="pagepeel01.swf" width="100%" height="100%" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent"></embed>

  </object>

</noscript></div>

</div>

</body>

</html>

 

Which brings up an error has occured in the script on this page, when I click on the yes button to continue running scripts on this page it runs OK

 

Here is AC_RunActiveContent.js

 

//v1.0

//Copyright 2006 Adobe Systems, Inc. All rights reserved.

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 = '<object ';

  for (var i in objAttrs)

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

  str += '>';

  for (var i in params)

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

  str += '<embed ';

  for (var i in embedAttrs)

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

  str += ' ></embed></object>';

 

  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.toLowerCase();   

 

    switch (currArg){

      case "classid":

        break;

      case "pluginspage":

        ret.embedAttrs[args] = 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":

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

        break;

      case "width":

      case "height":

      case "align":

      case "vspace":

      case "hspace":

      case "class":

      case "title":

      case "accesskey":

      case "name":

      case "id":

      case "tabindex":

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

        break;

      default:

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

    }

  }

  ret.objAttrs["classid"] = classid;

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

  return ret;

}

 

any help welcome,

Thanks

Peter

 

 

Link to comment
https://forums.phpfreaks.com/topic/64866-swf-file-wont-play/
Share on other sites

The problem is in AC_RunActiveContent.js. The function you're calling, AC_FL_RunContent(), calls the function AC_GetArgs(), with a parameter arguments, which is nowhere defined. The JavaScript engine interprets arguments to be null, then the scripts pukes when you call var currArg = args.toLowerCase() on a null string.

 

To fix it, you need to define the variable arguments somewhere.

Link to comment
https://forums.phpfreaks.com/topic/64866-swf-file-wont-play/#findComment-323683
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.