FLASH图片广告系统使用心得

原理:使用javascript和FALSH进行数据交换
文件:一个调用FLASH和含有JAVASCRIPT的html文件+一个广告FLASH文件

<script type="text/javascript">
     
<!--
     
     
var focus_width=220
     
var focus_height=180
     
var text_height=25
     
var swf_height = focus_height+text_height
     
     
//var pics='http://image2.sina.com.cn/ty/U346P6T29D1F3463DT20051205120604.jpg|http://image2.sina.com.cn/ty/U346P6T29D1F3465DT20051205120604.jpg'
     
      
var pics='images/2.jpg|images/3.jpg|images/4.jpg|images/4.jpg'
     
     
var links='http://www.cnblogs.cn/|http://www.163.com/|http://www.csdn.net/|http://www.tom.com/'    
     var texts='孙继海庆祝曼城大胜|邵佳一难以挽回败局|aa|bb|cc'        
     
    document.write('
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
    document.write('
<param name="allowScriptAccess" value="sameDomain"><param name="movie"  value="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#DADADA">');
    document.write('
<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('
<param name="FlashVars"  value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
    document.write('
<embed src="http://image2.sina.com.cn/bj/zonghe/pixviewer.swf" wmode="opaque"  FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false"  bgcolor="#DADADA" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer" />');        document.write('</object>');

     
//-->
     
</script> 

     
     
     

focus_width  用来设置FLASH宽度
focus_height  用来设置FLASH高度
text_height  设置显示字体区域高度(字会显示在FLASH最下面,如果是0就不显示)
pics      设置加载图片的地址,中间以“|”分隔
links      设置加载图片链接的地址,中间以“|”分隔
texts     设置加载图片说明文字的地址,中间以“|”分隔,如果text_height设置是0的话就不会显示

posted on 2006-09-04 16:54  Leetle  阅读(421)  评论(0编辑  收藏  举报

导航