FLASH控件激活问题的解决办法

 

参考E文地址http://blog.deconcept.com/swfobject/

这个JS可以在上述的网站下载,使用非常 

< div  id ="flashcontent" > 这里放上你想替换flash的文字。 div >

    
< script  type ="text/javascript" >  
    
var fo = new FlashObject("http://www.s-teda.com/images/bannerbusiness.swf""mymovie""703""102""7""#FFF"); 
    fo.write(
"flashcontent"); 
    
script >  

解释一下FlashObject各个参数

定义是这样的:

 

var  so  =   new  SWFObject(swf, id, width, height, version, background - color [, quality, xiRedirectUrl, redirectUrl, detectKey

比需参数部分:

  • swf - 就是要显示的flash文件
  • id - 就是你这个flash Object的ID.
  • width - 宽.
  • height - 高.
  • version - flash播放器版本号. An example would be: "6.0.65". Or you can just require the major version, such as "6".
  • background-color - 背景色.

选填参数部分:

  • quality - The quality you wish your Flash movie to play at. If no quality is specified, the default is "high".
  • xiRedirectUrl - If you would like to redirect users who complete the ExpressInstall upgrade, you can specify an alternate URL here
  • redirectUrl - If you wish to redirect users who don't have the correct plug-in version, use this parameter and they will be redirected.
  • detectKey - This is the url variable name the SWFObject script will look for when bypassing the detection. Default is 'detectflash'. Example: To bypass the Flash detection and simply write the Flash movie to the page, you could add ?detectflash=false to the url of the document containing the Flash movie.

 

还可以这样用

< script  type ="text/javascript" >
   
var so = new SWFObject("movie.swf""mymovie""400""100%""8""#336699");
   so.addParam(
"quality""low");
   so.addParam(
"wmode""transparent");
   so.addParam(
"salign""t");
   so.write(
"flashcontent");
script >

这样用:

< script  type ="text/javascript" >
   
var so = new SWFObject("movie.swf""mymovie""400""200""8""#336699");
   so.addVariable(
"variable1""value1");
   so.addVariable(
"variable2""value2");
   so.addVariable(
"variable3""value3");
   so.write(
"flashcontent");
script >

这个更强悍(取得本页的query参数)

< script  type ="text/javascript" >
   
var so = new SWFObject("movie.swf""mymovie""400""200""8""#336699");
   so.addVariable(
"variable1", getQueryParamValue("variable1"));
   so.addVariable(
"variable2", getQueryParamValue("variable2"));
   so.write(
"flashcontent");
script >

你可能感兴趣的:(FLASH控件激活问题的解决办法)