MVC3 js+flash图片滚动

@model List<Advertising>
@{
    ViewBag.Title = "AdList";
    Layout = null;
    var pics1="";
    var links1 = "";
    var FlashVars1 = "";
}
@for(var i=0;i<Model.Count;i++)
{
     pics1 += Model[i].ImageUrl+"|";
     links1 += Model[i].LinkUrl+"|";
}
@{FlashVars1 = "pics=" + pics1 + links1 + "&amp;texts=&amp;borderwidth=307&amp;borderheight=258&amp;textheight=0";}
<script type="text/javascript">
    $(function () {
        $("embed").attr("flashvars", $("#hiddenFlash").val())
    })
</script>
<input type="hidden" value="@FlashVars1" id="hiddenFlash" />
<input type="hidden" value="@pics1" id="hiddenpic" />
<input type="hidden" value="@links1" id="hiddenlink" />
<div class="kv">
        <!-- matrix: 1103 city: all time:2013-03-23 21:53:21-->
        <script type="text/javascript">
            var focus_width = 380
            var focus_height = 226
            var focus_width2 = focus_width + 2
            var focus_height2 = focus_height + 2
            var text_height = 0
            var swf_height = focus_height + text_height
            var pics = $("#hiddenpic").val().substring(0, $("#hiddenpic").val().length - 1)
            var links = $("#hiddenlink").val()
            var texts = ""

            var flashCode = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/hotdeploy/flash/swflash.cab#version=6,0,0,0" width="' + focus_width + '" height="' + swf_height + '">';
            flashCode = flashCode + '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://image.ledu.com/jjsg/swf/focus2.swf"><param name="quality" value="high"><param name="wmode" value="transparent">';
            flashCode = flashCode + '<param name="menu" value="false">';
            flashCode = flashCode + '<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">';
            flashCode = flashCode + '<embed src="http://image.ledu.com/jjsg/swf/focus2.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + focus_width + '" height="' + swf_height + '" FlashVars="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width2 + '&borderheight=' + focus_height2 + '&textheight=' + text_height + '"></embed>';
            flashCode = flashCode + '</object>';
            document.write(flashCode);</script>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/hotdeploy/flash/swflash.cab#version=6,0,0,0"
            height="226" width="380">
            <param name="allowScriptAccess" value="sameDomain">
            <param name="movie" value="http://image.ledu.com/jjsg/swf/focus2.swf">
            <param name="quality" value="high">
            <param name="wmode" value="transparent">
            <param name="menu" value="false">
            <param name="FlashVars" value="pics=http://pic.ledu.com/image/source/2013/3/14/142471_c6119.jpg|http://uppic.ledu.com/image/source/2013/2/13/135391_561e3.jpg&amp;links=http://jjsg.ledu.com/gonggao/11772.html|http://jjsg.ledu.com/card|&amp;texts=&amp;borderwidth=305&amp;borderheight=256&amp;textheight=0">
            <embed src="http://image.ledu.com/jjsg/swf/focus2.swf" wmode="transparent" quality="high"
                pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"
                 flashvars="pics=;texts=&amp;borderwidth=307&amp;borderheight=258&amp;textheight=0"
                height="226" width="380"></object>
        <!-- end matrix: 1103-->
    </div>
View Code

 

posted on 2013-05-24 11:54  douqiumiao  阅读(128)  评论(0编辑  收藏  举报