douwen5066 2012-11-21 12:07
浏览 43

用php中的图像替换flash

I am newby in php and i have a small problem.

I have a flash in my index php, like this

<div class="flash">
        <script language="JavaScript" type="text/javascript">
        /* <![CDATA[ */
            if (AC_FL_RunContent == 0) {
                alert("This page requires AC_RunActiveContent.js.");
            } else {
               AC_FL_RunContent(
                    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                    'width', '903',
                    'height', '301',
                    'src', 'swf/whatever',
                    'quality', 'high',
                    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                    'align', 'middle',
                    'play', 'true',
                    'loop', 'true',
                    'scale', 'showall',
                    'wmode', 'transparent',
                    'devicefont', 'false',
                    'id', 'whatever',
                    'bgcolor', '#ffffff',
                    'name', 'whatever',
                    'menu', 'true',
                    'allowFullScreen', 'false',
                    'allowScriptAccess','sameDomain',
                    'movie', 'swf/whatever',
                    'salign', ''
                    ); //end AC code
            }
        /* ]]> */
        </script>
</div>

i want an image there where flash cannot be displayed, let's say iOS systems. ex.

Can anyone help me?

  • 写回答

1条回答 默认 最新

  • dsqa6272 2012-11-21 12:18
    关注

    You can try with the following trick:

    <script language="JavaScript" type="text/javascript">
            /* <![CDATA[ */
                if (AC_FL_RunContent == 0) {
    
                    document.write("<img src='/path/to/image.png'>");
    
                    } else {
        ...
                    }
                /* ]]> */
            </script>
    

    If you show an alert window with the text "This page requires AC_RunActiveContent.js." using the original page code the previous example should work.

    If don't show the warning nor the flash content you should change the line

        if (AC_FL_RunContent == 0) { 
    

    for

       if (typeof AC_FL_RunContent === 'undefined') {
    

    The difference is that in the first piece of code the variable AC_FL_RunContent must be created to work properly. The second code checks if the variable actually exists.

    You colud mix both methods.

    Good luck.

    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等