title: Problems with cloning an object (.clone) in IE
body: <p>I am cloning a flash in ie and change some variable while that. This is the function:</p>
  
  <pre><code>$(function() {
    $("select[name='variation3']").live('change', function() {
      var player = $(this).parent().parent().parent().find('object:first');
      if(player.length == 0)
        player = $(this).parent().parent().parent().find('.player_not_single, .player_singele');
  
      var $param = player.find("param[name='flashvars']");
      var path = player.closest('.post1').attr('data-demo');
  
      //$param.attr('value', $param.attr('value').replace(/soundFile=([^&amp;]+)/, 'soundFile=' + path + $(this).find(':selected').val() + '.mp3'));
  
      $param.attr("value", function(i,v) { return v.replace(/soundFile=([^&amp;]+)/, 'soundFile=' + path + $(this).find(':selected').val() + '.mp3'); });
  
      var new_player = player.clone();
      new_player.insertBefore(player);
      player.remove();
    });
  });
  </code></pre>
  
  <p>In FF it works fine, but inIE it makes problems. This is the code before the cloning:</p>
  
  <pre><code>&lt;object name="audioplayer_1" width="270" height="24" id="audioplayer_1"
          classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
          style="outline-style:none; outline-color:invert; outline-width:medium;"&gt;  
    &lt;param name="bgcolor" value="#FFFFFF"/&gt;  
    &lt;param name="wmode" value="transparent"/&gt;  
    &lt;param name="menu" value="false"/&gt;  
    &lt;param name="flashvars"  value="animation=no&amp;encode=no&amp;initialvolume=60&amp;remaining=no&amp;noinfo=yes&amp;buffer=3&amp;checkpolicy=no&amp;rtl=no&amp;bg=363635&amp;text=333333&amp;leftbg=4f4f4f&amp;lefticon=787171&amp;volslider=71bced&amp;voltrack=777987&amp;rightbg=4d4d4d&amp;rightbghover=66a7d9&amp;righticon=969696&amp;righticonhover=000000&amp;track=c2bebe&amp;loader=5f91f5&amp;border=000000&amp;tracker=90b7d1&amp;skip=b3b3b3&amp;soundFile=http%3A%2F%2Fwww.gameaudio.net%2Fprelisten%2Fanotherworld%2Ffulledit.mp3&amp;playerID=audioplayer_1"/&gt;  
    &lt;param name="movie" value="http://www.gameaudio.net/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1"/&gt;  
  &lt;/object&gt;  
  </code></pre>
  
  <p>And this the code after cloning:</p>
  
  <pre><code>&lt;object name="audioplayer_1" width="270" height="24" id="audioplayer_1"
          classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
          style="outline-style:none; outline-color:invert; outline-width:medium;"&gt;  
    &lt;param name="_cx" value="7143"/&gt;  
    &lt;param name="_cy" value="635"/&gt;  
    &lt;param name="FlashVars" value=""/&gt;  
    &lt;param name="Movie" value="http://www.gameaudio.net/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1"/&gt;  
    &lt;param name="WMode" value="Transparent"/&gt;  
    &lt;param name="BGColor" value="FFFFFF"/&gt;  
    [...]  
  &lt;/object&gt;
  </code></pre>
  
  <p>It is not the same. In parts yes, but not all and esp. the most important parts are missing.
  What could be the error?</p>
  
  <p>UPDATE:
  This is my current code:
  'function embedAudioPlayer(replaceElemIdStr, audioFile) {  </p>
  
  <pre><code>swfobject.embedSWF(   
      "http://www.gameaudio.net/wp-content/plugins/audio-player/assets  /player.swf?ver=2.0.4.1",   
      replaceElemIdStr,   
      width,   
      height,   
      "9.0.115",   
      "expressInstall.swf",  
      {  
          soundFile: audioFile  
      });  
  </code></pre>
  
  <p>}   </p>
  
  <p>$(function() {  </p>
  
  <p>$("select[name='variation3']").live('change', function() {  </p>
  
  <pre><code>player = $(this).parent().parent().parent().find('.player_not_single,   .player_singele');
  
  var $param = player.find("param[name='flashvars']");  
  var path = player.closest('.post1').attr('data-demo');  
  var audioFile = path + $(this).find(':selected').val() + '.mp3';  
  var uniqueId = 'audio-' + +new Date;  
  player.replaceWith('&lt;div id="+uniqueId+"/&gt;');  
  embedAudioPlayer(uniqueId, audioFile);  
  </code></pre>
  
  <p>}); 
      '</p>
  
  <p>function embedAudioPlayer(replaceElemIdStr, audioFile) {
  var swfobject = audioplayer_swfobject;<br>
      swfobject.embedSWF(
          "http://www.gameaudio.net/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1", 
          replaceElemIdStr, 
          250, 
          50, 
          "9.0.115", 
          "expressInstall.swf",
          {
              soundFile: audioFile
          });
  }</p>
  
  <p>$(function() {</p>
  
  <p>$("select[name='variation3']").live('change', function() {</p>
  
  <pre><code>player = $(this).parent().parent().parent().find('.player_not_single, .player_singele');
  
  var $param = player.find("param[name='flashvars']");
  var path = player.closest('.post1').attr('data-demo');
  var audioFile = path + $(this).find(':selected').val() + '.mp3';
  var uniqueId = 'audio-' + +new Date;
  player.replaceWith('&lt;div id="+uniqueId+"/&gt;');
  embedAudioPlayer(uniqueId, audioFile);
  </code></pre>
  
  <p>});</p>
  
  <p>Update:</p>
  
  <p>`
    function embedAudioPlayer(replaceElemIdStr, audioFile) {
  var swfobject = audioplayer_swfobject;<br>
      swfobject.embedSWF(
          "http://www.gameaudio.net/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1", 
          replaceElemIdStr, 
          250, 
          50, 
          "9.0.115", 
          "expressInstall.swf",
          {
              soundFile: audioFile
          });
  }</p>
  
  <p>$(function() {</p>
  
  <p>$("select[name='variation3']").live('change', function() {</p>
  
  <pre><code>player = $(this).parent().parent().parent().find('.player_not_single, .player_singele');
  
  var $param = player.find("param[name='flashvars']");
  var path = player.closest('.post1').attr('data-demo');
  var audioFile = path + $(this).find(':selected').val() + '.mp3';
  var uniqueId = 'audio-' + +new Date;
  player.replaceWith('&lt;div id="+uniqueId+"/&gt;');
  embedAudioPlayer(uniqueId, audioFile);
  </code></pre>
  
  <p>});`</p>