title: Changing the data of a object and the value of a parameter inside the embed from twitch
body: <p>Hello I am trying to change the data of a object and the value of a parameter inside the embedding code from twitch.<br>
  I am not that good on javascript and could use some help.<br>
  I have done my research with no luck.<br>
  all help is appreciated :)
  <hr>
  the embedding code that i want to change (this is a fresh embedding code, no edits)</p>
  
  <pre><code>&lt;object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=thelifeisyours" bgcolor="#000000"&gt;
      &lt;param name="allowFullScreen" value="true" /&gt;
      &lt;param name="allowScriptAccess" value="always" /&gt;
      &lt;param name="allowNetworking" value="all" /&gt;
      &lt;param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /&gt;
      &lt;param name="flashvars" value="hostname=www.twitch.tv&amp;channel=thelifeisyours&amp;auto_play=true&amp;start_volume=25" /&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p><br>
  here is the js i got so far and it doesn't work :P (remember i am a noob in js)</p>
  
  <pre><code>function changestream1(){
      var streamIn = document.getElementById('stream1').value;
      var objData= document.getElementById('live_embed_player_flash');
      var param = document.getElementById('param');
  
      objData.setAttribute("data", "http://www.twitch.tv/widgets/live_embed_player.swf?channel=" + streamIn); 
      param.setAttribute("value", "hostname=www.twitch.tv&amp;channel=" + streamIn + "&amp;auto_play=true&amp;start_volume=25"); 
  }
  </code></pre>
  
  <p>the idea is that the js will create the data in the object and the value in the parameter.
  <hr>
  if you need a visual of how i am thinking this out press Link :D
  <br>
  <a href="http://jsfiddle.net/QnWvR/" rel="nofollow">JsFiddle</a>
  <br><br>
  link to the website where this is going to be used<br>
  <a href="http://twitchgrabber.0fees.net" rel="nofollow">twitchgrabber</a></p>