Image Image Image Image Image
Scroll to Top

To Top

php

19

May
2015

Information Resources

Permalink

By admin404

Twitter Cards and WordPress

May 19, 2015 - Information Resources

In our “Twitter CardsInformation Resource (February 2013), we shared with you a step-by-step guide for setting up your meta-tags, testing, and applying to Twitter to implement Twitter Cards into your WordPress site. Over the last two years, we’ve updated our process to best suit our clients who want to refine Twitter Card content for their WordPress sites, and overcome the limitations of sites with AJAX-loaded content, which was previously impossible with Twitter.

Read More

Tags | .htaccess, ajax, ajax-loaded, dynamic content, lazy load, php, tips, tutorial, twitter, twitter cards, wordpress

19

Jun
2006

Information Resources

Permalink

By admin404

Activating an ActiveX Control’s Interface through Javascript

June 19, 2006 - Information Resources

Removing the Marching Ants around SWF Files

As a result of the jury decision in Microsoft’s Eolas patent lawsuit, Microsoft created an Internet Explorer update that would force users to activate media items coded with “embed”, “applet” or “object” tags. The result of this decision is that while movies may play and function correctly in Firefox, Safari and other browsers, users must click Flash media to “activate” it and accept ActiveX alerts on pages containing Quicktime media.

A solution to this obstacle has been dutifully created and promoted by Geoff Stearns. His “SWFObject” (grab it here) is a simple Javascript which enables developers to embed Flash files into sites without using “embed”, “applet” or “object”.

For instance, we used to have our home page navigation coded like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="796" height="72" id="nav_home" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="nav_home.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="nav_home.swf" quality="high" bgcolor="#ffffff" width="796" height="72" name="nav_home" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

With Mr. Stearns’ SWFObject, the syntax is shorter and effective. In the head, we include his Javascript file:
<script type="text/javascript" src=js/swfobject.js"></script>

And in the body, we replace the object and embed tags with this:
<div id="navcontent"></div>
<script type="text/javascript">
// <![CDATA[
var a = new SWFObject(swf/nav_home.swf", "fo_nav", "796", "72", "7,0,0,0", "#FFFFFF", true);
a.addParam("allowScriptAccess", "sameDomain");
a.addParam("quality", "high");
a.addParam("scale", "noscale");
a.write("navcontent");
// ]]>
</script>

The SWFObject allows for you to add all the parameters of Adobe’s default export using the addParam function.

To make things better, you can still pass variables to and from the Flash from PHP by adding the FLASHVARS variable with Stearns’ addParam function.

For instance, our interior navigation, with the PHP/Smarty variables, looks like this:

<div id="navcontent"></div>
<script type="text/javascript">
// <![CDATA[
var a = new SWFObject(swf/nav_home.swf", "fo_nav", "796", "72", "7,0,0,0", "#FFFFFF", true);
a.addParam("allowScriptAccess", "sameDomain");
a.addParam("quality", "high");
a.addParam("scale", "noscale");
a.addParam("FLASHVARS", "section=‹$section›")
a.write("navcontent");
// ]]>
</script>

The resourceful Stearns’ provides the identical solution for embedding Quicktime movies to eradicate Microsoft’s ActiveX alert window.

Include his QTObject Javascript file in the head of your page:

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

And modify the code for your Quicktime video to use his format:
<div id="video">
<script type="text/javascript">
// <![CDATA[
var myQTObject = new QTObject("reels/web.mov", "qo_web", "480", "376");
myQTObject.write();
// ]]>
</script>
</div>

Incorporating the add.Param function for Quicktime parameters, you can easily add poster movies and controller options the same way you would in Flash:
<div id="video">
<script type="text/javascript">
// <![CDATA[
var myQTObject = new QTObject("reels/reel_web_posterMovie.mov", "qo_web", "480", "376");
myQTObject.addParam("qtsrc", "reels/reel_web_posterMovie.mov");
myQTObject.addParam("href", "reels/web.mov");
myQTObject.addParam("target", "myself");
myQTObject.addParam("controller", "false");
myQTObject.write();
// ]]>
</script>
</div>

Recommended Links

SWFObject Download (zip)
QTObject Download (zip)
SWFObject Documentation
QTObject Documentation

Tags | activate flash, adobe, citarella, fix, fla, flash object, html, issue, macromedia, microsoft activex, patch, php, problem, quicktime embed, swf, swf object