---
title: "在firefox下调用flash对象的方法不成功的解决办法"
author: "floydd"
date: "2008-03-21T14:08:00Z"
tags: []
slug: "firefox-flash"
draft: false
lastmod: "2011-12-26T12:03:10Z"
id: 1326378
url: "https://floydd.iteye.com/blog/1326378"
---

![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="zh-CN"lang="zh-CN"&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;head&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;title&gt;yiguo&lt;/title&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)&lt;SCRIPTLANGUAGE="JavaScript"&gt;...  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)varpos=1;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)functiontoggle()...{  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)varf=null;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)if(document.f1)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)f=document.f1;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)else  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)f=document.getElementById('f1');  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)f.SetVariable('scheduleFrame',++pos%2+2);  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)}  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)document.onclick=function()...{  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)toggle();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)}  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;/SCRIPT&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;/head&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;bodybgcolor="#ffffff"&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;!--  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)注意：  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)1.flash的id是获取这个flash的唯一标识。强烈建议你不要写flashobject的name（如果一定要的话千万不要和id一样），否则firefox会出问题  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)2.flash中的embed元素的name属性一定要和flashobjectid一样，否则firefox也会有问题  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)...ff有时候也真是麻烦～  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)--&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;objectid="f1"classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"width="183"height="209"align="middle"&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;paramname="movie"value="yiguo.swf"/&gt;  
&lt;embed name="f1" src="yiguo.swf"quality="high"bgcolor="#ffffff"width="183"height="209" align="middle"type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer"/&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;/object&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;/body&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)&lt;/html&gt;  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)