embedSWF: function()

in source/javascripts/libs/swfobject-dynamic.js [224:262]


		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, flashvarsObj, parObj, attObj, callbackFn) {
			var callbackObj = {success:false, id:replaceElemIdStr};
			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
              widthStr += ""; // auto-convert to string
              heightStr += "";
              var att = {};
              if (attObj && typeof attObj === OBJECT) {
                for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
                  att[i] = attObj[i];
                }
              }
              att.data = swfUrlStr;
              att.width = widthStr;
              att.height = heightStr;
              var par = {};
              if (parObj && typeof parObj === OBJECT) {
                for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
                  par[j] = parObj[j];
                }
              }
              if (flashvarsObj && typeof flashvarsObj === OBJECT) {
                for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
                  if (typeof par.flashvars != UNDEF) {
                    par.flashvars += "&" + k + "=" + flashvarsObj[k];
                  }
                  else {
                    par.flashvars = k + "=" + flashvarsObj[k];
                  }
                }
              }
              if (hasPlayerVersion(swfVersionStr)) { // create SWF
                var obj = createSWF(att, par, replaceElemIdStr);
                callbackObj.success = true;
                callbackObj.ref = obj;
              }
              if (callbackFn) { callbackFn(callbackObj); }
			}
			else if (callbackFn) { callbackFn(callbackObj);	}
		},