Forum Moderators: open

Message Too Old, No Replies

Flash (swf) link doesn't work in some browsers

Flash (swf) link doesn't work in Firefox

         

N66FC Raptor

6:49 pm on Sep 27, 2006 (gmt 0)

10+ Year Member



In reply to user: kschneidman [webmasterworld.com ]

"I've created a silly little flash file (swf) using Photoshop. I thought it was a better alternative to an animated gif. It functions as an ad/link to another page. The link works fine in IE and Safari but doesn't work at all in Firefox or Camino. What's wrong here? Am I missing something?"

Try using JavaScript to "embed" your swf. For example, the default "Express Install Example", from the "Flash Player Kit" available at [adobe.com ] uses JavaScript to embed swf. I've modified the links using W3Cs [validator.w3.org ] Link Checker as the links weren't validating. The following XHTML passes validation and can be viewed in most browsers, including Firefox.


<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">

<head>
<title>Express Install Example</title>
<meta http-equiv="Content-Type" content="application/x-shockwave-flash; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<style type="text/css">
<!--
html, body, table {
height: 100%;
margin: 0px;
padding: 0px;
text-align: center;
}
td {
height: 100%;
vertical-align: top;
}
#wrapper {
margin: 0 auto;
text-align: left;
width: 100%;
}
//-->
</style>
<!-- Get 'Flash Detection Kit' from http://www.adobe.com/products/flashplayer/download/detection_kit/ -->
<script type="text/javascript">
<!-- Globals -->
<!-- Major version of Flash required -->
var requiredMajorVersion = 8;
<!-- Minor version of Flash required -->
var requiredMinorVersion = 0;
<!-- Minor version of Flash required -->
var requiredRevision = 0;
</script>
<!-- Get 'Flash Detection Kit' from http://www.adobe.com/products/flashplayer/download/detection_kit/ -->
<script type="text/javascript" src="AC_OETags.js"></script>
</head>

<body>
<!-- Place large border to display 100% width and 100% height table, validates! -->
<table id="wrapper" width="100%" cellspacing="0" cellpadding="0" border="15">
<tr>
<td valign="top">
<script type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall &&!hasReqestedVersion ) {
// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true)? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;

AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "550",
"height", "300",
"align", "middle",
"id", "detectionExample",
"quality", "high",
"bgcolor", "#3A6EA5",
"name", "detectionExample",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
);
} else if (hasReqestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "example",
"width", "550",
"height", "200",
"align", "middle",
"id", "detectionExample",
"quality", "high",
"bgcolor", "#FFFFFF",
"name", "detectionExample",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
'codebase', 'http://download.adobe.com/get/flashplayer/current/swflash.cab',
"pluginspage", "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here.<BR>'
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<p>Provide alternate content for browsers that do not support scripting or for
those that have scripting disabled. Alternate HTML content should be placed
here. This content requires the Adobe Flash Player and a browser with JavaScript
enabled. <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
>Get Flash</a></p>
</noscript>
</td>
</tr>
</table>
</body>

</html>