
Advertise
|
About us
|
Site map
|
Syndicate
|
Search site
|
Mailing list
|
View Authors
|
Become an Author
Home 	Tutorials 	Forums 	Articles 	Blogs 	Movies 	Library 	Employment 	Press 	Buy templates

Go Back 	  	ActionScript.org Forums > Supporting Technologies > HTML and JavaScript
Reload this Page ieupdate.js with Flash Detection?
	
User Name 		Remember Me?
Password 		
Register 	FAQ 	Members List 	Calendar 	Today's Posts 	Search

Search Forums
Show Threads   Show Posts
Advanced Search
Go to Page...
Reply
 
	Thread Tools 	Rate Thread 	Display Modes
Old 05-26-2006, 10:57 PM 	  #1
selliott
Member
 
Join Date: Nov 2004
Posts: 99
	
Default ieupdate.js with Flash Detection?
Ok, I have the ieupdate.js stuff working with normal flash sites, but when I turn on the flash detection, the code changes...and I'm not sure how to adjust the "IE Fix" to get it to work correctly. With this code, it works in IE, but not in Firefox or Netscape. I'm sure I'm doing something wrong, just not sure what.

First I put the script in the head tags:

Code:

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

Then added the startEeFix and endIeFix lines.


Code:

<script language="JavaScript" type="text/javascript">
<!-- 
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {  // if we've detected an acceptable version
    var oeTags = '<script language="JavaScript" type="text/javascript">startIeFix();<\/script><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="750" height="460"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="frontpage.swf" /><param name="quality" value="best" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000099" />'
    + '<embed src="frontpage.swf" quality="best" wmode="transparent" bgcolor="#000099" '
    + 'width="750" height="460" name="frontpage" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object><!-- --><script type="text/javascript">endIeFix();<\/script>';
    document.write(oeTags);   // embed the flash movie
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'You need to update your flash player.'
  	+ 'This content requires the Macromedia Flash Player.'
   	+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
  }
// -->
</script>
    
<noscript>
	// Provide alternate content for browsers that do not support scripting
	// or for those that have scripting disabled.
  	<div align="center"><font color="#FFFFFF">You need to download Flash Player 8 to view this website.</font>
  	<a href="http://www.macromedia.com/go/getflash/">Get Flash</a></div>  	
</noscript>

and here's the ieupdate.js file

Code:

var bo_ns_id = 0;

function startIeFix(){
if(isIE()){
document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
}
}

function endIeFix(){
if(isIE()){
document.write('</div>');
var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
var theCode = theObject.innerHTML;
theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
document.write(theCode);
}
}

function isIE(){
// only for Win IE 6+
// But not in Windows 98, Me, NT 4.0, 2000
var strBrwsr= navigator.userAgent.toLowerCase();
if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
return false;
}
if(strBrwsr.indexOf("win98") > -1 ||
strBrwsr.indexOf("win 9x 4.90") > -1 ||
strBrwsr.indexOf("winnt4.0") > -1 ||
strBrwsr.indexOf("windows nt 5.0") > -1)
{
return false;
}
return true;
}else{
return false;
}
}

Last edited by selliott; 05-27-2006 at 12:08 AM..
selliott is offline   	Reply With Quote
selliott
View Public Profile
Find More Posts by selliott
Old 05-27-2006, 01:10 AM 	  #2
selliott
Member
 
Join Date: Nov 2004
Posts: 99
	
Default
I think I figured it out. I changed the code in the head tag to:

Code:

<!--[if gte IE 6]><script type="text/javascript" src="ieupdate.js"><![endif]--></script>

and it seems to be working so far.
Last edited by selliott; 05-27-2006 at 01:20 AM..
selliott is offline   	Reply With Quote
selliott
View Public Profile
Find More Posts by selliott
 
Reply

« Previous Thread | Next Thread »


Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode
Hybrid Mode Switch to Hybrid Mode
Threaded Mode Switch to Threaded Mode
Rate This Thread
ExcellentExcellent
GoodGood
AverageAverage
BadBad
TerribleTerrible
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Rules
	
Forum Jump
User Control PanelPrivate MessagesSubscriptionsWho's OnlineSearch ForumsForums Home ActionScript Forums Group    ActionScript 3.0    ActionScript 2.0    ActionScript 1.0 (and below)    Simple Stuff (Newbies) Flash General Questions    Flash 9 General Questions    Flash 8 General Questions    Other Flash General Questions Flex    Flex 2 & 3    Flex 1 Extensions and Plugins    Components    JSFL - Extending Flash Desktop, Mobile and non-browser Environments    AIR (Apollo)    FlashLite / Portable Devices Development    Projectors and CDs Supporting Technologies    HTML and JavaScript    haXe    Server-Side Scripting    Flash Remoting    Flash Media Server General    Best Practices    Gaming and Game Development    Animation and Effects    Flashants Support Forum Community Boards    General Chat    Just for Kicks Challenges    Detention Flash In Action    Site Check    Cool Sites    Widgets Decommissioned    Projects and Positions CMS Forums    Announcements Board    Content Postings / Updates    Product Review Requests    CMS Technical Questions    Process Questions    Collaboration & Suggested Articles

Similar Threads
Thread 	Thread Starter 	Forum 	Replies 	Last Post
Optimizing Flash Web Sites for Search Engines 	rockcoastmedia 	General Chat 	20 	03-29-2009 10:31 PM
Flash player detection on website with multiple entry points 	cruiserparts 	ActionScript 1.0 (and below) 	0 	05-25-2005 06:43 PM
flash detection for cd-rom 	Don9 	ActionScript 1.0 (and below) 	1 	04-04-2005 11:35 AM
scrollBar on Flash Exchange 	cdeg 	Components 	5 	05-03-2004 08:13 PM
Detection and install of flash 5 	tinotek 	Other Flash General Questions 	2 	05-24-2003 09:19 PM


All times are GMT. The time now is 12:03 PM.

Contact Us - Home Page - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.

