So when the swfoject does it's replacing ofthe alt content dic,it removes the div and replaces is with a object tag which cannot have the same css properties applied. Try creating a wrapper div which has your sizing / positioning css and place the alt content div inside.
Also, you might be interested in this tut describing how to replace 1 swf with another on button click: http://pipwerks.com/lab/swfobject/load-onclick/2.0/index.html (section "Using an 'onclick' event to replace a loaded SWF with another SWF" describes the extra hoops you have to jump through) Cheers, Aran On Oct 1, 8:37 pm, enzo <[email protected]> wrote: > Hi, > > I've done a minimalistic code to create dynamically a flash player. > When I open IE8 browser, i click on the button to create the stuff, it > works > I then refresh IE8 one time, I click on the button and then the player > is completely tiny > (if you see the player at the good size, just refresh IE8, and the > problem should come) > > Here is the code. If someone has an idea... my brain is going to > burn... > (the problem is the same if I use createSWF or embedSWF) > > ------------------------------------ CUT HERE > ------------------------------- > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ > TR/html4/strict.dtd"> > <html> > <head> > <title>Demo</title> > <style type="text/css"> > .div_style { > border: 1px solid yellow; > width: 320px; > height: 240px; > } > </style> > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ > libs/swfobject/2.2/swfobject.js"></script> > > <script type="text/javascript"> > > function showFlashPlayer(media_title, media_url) { > var flash_div = document.createElement("div"); > flash_div.id = "flash_div"; > flash_div.className = "div_style"; > flash_div.innerHTML = "content of the div"; > document.body.appendChild(flash_div); > > /*var att = { data:"http://flv-player.net/medias/ > player_flv_maxi.swf", width:"320", height:"240", styleclass: > "div_style" }; > var par = { allowFullScreen: true, flashvars:"flv=" + media_url > + "&autoplay=1&showstop=1&showvolume=1&showtime=1&showfullscreen=1" }; > var id = "flash_div"; > var flash_player = swfobject.createSWF(att, par, id);*/ > > var flashvars = {}; > var params = { > allowFullScreen: true, > flashvars:"flv=" + media_url + > "&autoplay=1&showstop=1&showvolume=1&showtime=1&showfullscreen=1" > }; > var attributes = { > styleclass: "div_style" > }; > swfobject.embedSWF("http://flv-player.net/medias/ > player_flv_maxi.swf", "flash_div", "320", "240", "9.0.0", > "expressInstall.swf", flashvars, params, attributes); > } > </script> > </head> > > <body> > <input type="button" value="Launch movie" onclick="showFlashPlayer > ('title of the movie', 'http://flv-player.net/medias/ > KyodaiNoGilga.flv')"> > </body> > </html> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---
