javascript - failed to add flash to HTML with swfobject -
help me plz,i'm mad... critical code below,it doesn't work,there nil in "object":
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"; // utilize express install, set playerproductinstall.swf, otherwise 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);
give try:
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); }
just add together id('flashcontent') div. hope helps.
javascript flash swfobject
No comments:
Post a Comment