2 Replies Latest reply on May 13, 2006 6:59 AM by onstabb

    about FlashActiveContent & FlashVars

      just a rewrite of a function in AC_RunActiveContent.js to support a FlashVar Parameter =D

      ------------------------------------------------------------------------
      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 "FlashVars":
      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;
      }
      ------------------------------------------------------------------------

      and the new html must say:

      -----------------------------------------------------------------------
      <script language="javascript">AC_FL_RunContent = 0;</script>
      <script src="AC_RunActiveContent.js" language="javascript"></script>
      <script language="javascript">
      if (AC_FL_RunContent == 0) {
      alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
      } else {
      AC_FL_RunContent(
      'codebase', ' http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
      'width', '157',
      'height', '157',
      'src', 'flashmovie',
      'quality', 'high',
      'pluginspage', ' http://www.macromedia.com/go/getflashplayer',
      'align', 'middle',
      'play', 'true',
      'loop', 'true',
      'scale', 'showall',
      'wmode', 'transparent',
      'devicefont', 'false',
      'id', 'someid',
      'bgcolor', '#ffffff',
      'name', 'lolcontent',
      'menu', 'true',
      'allowScriptAccess','sameDomain',
      'movie', 'flashmovie',
      'FlashVars','foo=var&bar=foo',
      'salign', ''
      ); //end AC code
      }
      </script>
      ------------------------------------------------------------------------

      See ya !!
      By TøCaÐø157
      Comments to :
      sromero(at)voie(dot)com(dot)ar