0

请帮帮我,我快疯了......关键代码在下面,它不起作用,“对象”中没有任何内容:

    var obj=document.createElement('object');
    obj.id="FlashFormulaEditor";
    obj.width="520";
    obj.height="500";
    document.body.appendChild(obj);
    table.appendChild(obj);
    var swfVersionStr = "9.0.0";
    // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
    var xiSwfUrlStr = "";
    var flashvars = {};
    var params = {};
    params.quality = "high";
    params.bgcolor = "#ffffff";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    var attributes = {};
    attributes.id = "FlashFormulaEditor";
    attributes.name = "FlashFormulaEditor";
    attributes.align = "middle";
    swfobject.embedSWF("./FlashFormulaEditor.swf", "FlashFormulaEditor",  "475", "552", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
4

1 回答 1

1

试试这个:

function initFlash(){
            var flashvars = {};
            var params = {};
            var attributes = {};
            params.quality = "high";
            params.play = "true";
            params.loop = "true";
            params.wmode = "transparent";
            params.scale = "showall";
            params.menu = "false";
            params.devicefont = "true";
            params.salign = "";
            params.allowScriptAccess = "always";
            params.allowFullScreen = "true";
            attributes.id = "swfLoader";
            attributes.name = "swfLoader";
            swfobject.embedSWF("your.domain/flash.swf", "flashContent", "100%", "100%", "11", false, flashvars, params, attributes);
        }

只需将 id('flashContent') 添加到您的 div 中。希望这可以帮助。

于 2013-03-12T05:15:59.977 回答