Friday 15 February 2013

Trouble embedding flash in HTML using object tag/swfobject -


I am trying to embed a flash file in one page, and have tried several variations below Two ways:

swfobject

  & lt; Head & gt; & Lt;% = javascript_include_tag 'swfobject.js'% & gt; & Lt; / Head & gt; . . . & Lt; Div id = "dragndrop" & gt; Adobe Flash is required to see it & lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Var flashvars; Var params = {movie: "lt;% = asset_path ('flash / drag-n-drop-w-action 3b swf')%>", background: "#FFFFF", quality: "high"} ; Swfobject.embedSWF ("& lt;% = asset_path ('flash / drag-n-drop-w-action3b.swf')%>", "dragandrop", "100%", "100%", "6.0 .0 ", false, advisory); & Lt; / Script & gt;   

There is nothing to keep track of the page yield, but the following is output to the browser:

  & lt; Object id = "dragndrop" width = "100%" height = "100%" type = "app / x-shockwave-flash" data = "/ asset / flash / drag-en-dop-w-action 3b sff" Style = "visibility: visible;" & Gt; & Lt; Param name = "flashvars" value = "movie = / assets / flash / drag-n-drop-w-action3b.swf and background = # FFFFFF and quality = high" & gt; & Lt; / Object & gt;   

I have also tried it for consultation without any profit.

I have also tried to add it in many ways, as described. This flash file has been successfully embedded on another website, and I have copied it to HTML here (fixing the path):

  & lt; Object width = "100%" height = "100%" align = "" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0, 0 "Classic =" clayed: D27CDB6E-AE6D-11cf-96B8-444553540000 "& gt; & Lt; Param value = "property / flash / drag-n-drop-w-action 3b swf" name = "movie" & gt; & Lt; Param value = "high" name = "quality" & gt; & Lt; Param value = "#ffff" name = "bgi rarara" & gt; & Lt; Embed width = "100%" height = "100%" align = "" pluginspage = "http://www.macromedia.com/go/getflashplayer" type = "application / x-shockw-flash" bgcolor = "#fffff "Quality =" high "src =" / property / flash / drag-n-drop-w-action 3b swf "& gt; & Lt; / Object & gt;   

What am I doing?

Edit:

The following piper support, I have changed the code to:

  var params = {Background: "#FFFFFF",}; Swfobject.embedSWF ("& lt;% = asset_path ('flash / drag-n-drop-w-action3b.swf')%>", "dragandrop", "100%", "100%", "6.0 .0 ", false, false, params);   

However, it is still not working quite a lot. The new HTML, which is output, is as follows:

  object object = "dragonpress" width = "100%" height = "100%" type = "application / x-shock - WiFlash "Data =" / Asset / Flash / Drag-n-Drop-W-Action 3b SWF "Style =" Visibility: Visible; "& gt; & Lt; Param name = "background" value = "#fffff" & gt; & Lt; / Object & gt;    

For starters, you are accidentally passing flashwars in the form of parameters.

Second, you do not need to pass most of those parameters, because they have already taken care of them. The first argument in SWFObject is: movie the ultimate. Default for Quality = High Flash Player and no need to specify. I believe #FFFFFF is also the default background color, but to specify it There will not be injury for you.

The correct sequence of arguments is:

   

Therefore your code should be:

  var params = {background: "#FFFFFF",}; Swfobject.embedSWF ("& lt;% = asset_path ('flash / drag-n-drop-w-action3b.swf')%>", "dragandrop", "100%", "100%", "6.0 .0 ", false, false, params);   

For more information about swfobject logic, see.

No comments:

Post a Comment