<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; 1.4.4</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/144/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SWFObject &#8211; Flash plugin detection &amp; embed</title>
		<link>http://www.ladysign-apps.com/blog/code/javascript/swfobject-flash-plugin-detection-embed/</link>
		<comments>http://www.ladysign-apps.com/blog/code/javascript/swfobject-flash-plugin-detection-embed/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 13:18:55 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[1.4.4]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[flash detection]]></category>
		<category><![CDATA[SWFObject]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=120</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Get rid of the SWF object activation for Internet Explorer; those stipped borders around your Adobe Flash object while em[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/javascript/swfobject-flash-plugin-detection-embed/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Get rid of the SWF object activation for Internet Explorer; those stipped borders around your Adobe Flash object while embedded in your page. Use the SWFObject script.</p>
<p>Place in the html page the values, to start this script.</p>
<pre class="brush: jscript; title: ;">
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == &quot;undefined&quot;) var deconcept = new Object();
if(typeof deconcept.util == &quot;undefined&quot;) deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == &quot;undefined&quot;) deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split(&quot;.&quot;))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +&quot;=&quot;+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = &quot;&quot;;
		if (navigator.plugins &amp;&amp; navigator.mimeTypes &amp;&amp; navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute(&quot;doExpressInstall&quot;)) { this.addVariable(&quot;MMplayerType&quot;, &quot;PlugIn&quot;); }
			swfNode = '&lt;embed type=&quot;application/x-shockwave-flash&quot; src=&quot;'+ this.getAttribute('swf') +'&quot; width=&quot;'+ this.getAttribute('width') +'&quot; height=&quot;'+ this.getAttribute('height') +'&quot;';
			swfNode += ' id=&quot;'+ this.getAttribute('id') +'&quot; name=&quot;'+ this.getAttribute('id') +'&quot; ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'=&quot;'+ params[key] +'&quot; '; }
			var pairs = this.getVariablePairs().join(&quot;&amp;&quot;);
			 if (pairs.length &gt; 0){ swfNode += 'flashvars=&quot;'+ pairs +'&quot;'; }
			swfNode += '/&gt;';
		} else { // PC IE
			if (this.getAttribute(&quot;doExpressInstall&quot;)) { this.addVariable(&quot;MMplayerType&quot;, &quot;ActiveX&quot;); }
			swfNode = '&lt;object id=&quot;'+ this.getAttribute('id') +'&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; width=&quot;'+ this.getAttribute('width') +'&quot; height=&quot;'+ this.getAttribute('height') +'&quot;&gt;';
			swfNode += '&lt;param name=&quot;movie&quot; value=&quot;'+ this.getAttribute('swf') +'&quot; /&gt;';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '&lt;param name=&quot;'+ key +'&quot; value=&quot;'+ params[key] +'&quot; /&gt;';
			}
			var pairs = this.getVariablePairs().join(&quot;&amp;&quot;);
			if(pairs.length &gt; 0) {swfNode += '&lt;param name=&quot;flashvars&quot; value=&quot;'+ pairs +'&quot; /&gt;';}
			swfNode += &quot;&lt;/object&gt;&quot;;
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) &amp;&amp; !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable(&quot;MMredirectURL&quot;, escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + &quot; - Flash Player Installation&quot;;
				this.addVariable(&quot;MMdoctitle&quot;, document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != &quot;&quot;) {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins &amp;&amp; navigator.mimeTypes.length){
		var x = navigator.plugins[&quot;Shockwave Flash&quot;];
		if(x &amp;&amp; x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, &quot;&quot;).replace(/(\s+r|\s+b[0-9]+)/, &quot;.&quot;).split(&quot;.&quot;));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject(&quot;ShockwaveFlash.ShockwaveFlash.7&quot;);
		}catch(e){
			try {
				var axo = new ActiveXObject(&quot;ShockwaveFlash.ShockwaveFlash.6&quot;);
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = &quot;always&quot;; // throws if player version &lt; 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject(&quot;ShockwaveFlash.ShockwaveFlash&quot;);
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable(&quot;$version&quot;).split(&quot; &quot;)[1].split(&quot;,&quot;));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major &lt; fv.major) return false;
	if(this.major &gt; fv.major) return true;
	if(this.minor &lt; fv.minor) return false;
	if(this.minor &gt; fv.minor) return true;
	if(this.rev &lt; fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split(&quot;&amp;&quot;);
			for (var i=0; i &lt; pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf(&quot;=&quot;)) == param) {
					return pairs[i].substring((pairs[i].indexOf(&quot;=&quot;)+1));
				}
			}
		}
		return &quot;&quot;;
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName(&quot;OBJECT&quot;);
	for (var i=0; i &lt; objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/javascript/swfobject-flash-plugin-detection-embed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

