0

I have a web page with swf file defined this way

<object width="600" height="400" type="application/x-shockwave-flash" id="plist" data="/site_media/apps/problemme.swf">
   <param id="board" name="flashvars" value="id={{ id }}">
</object>

What I want to do is to reload this object after button click (also I want to change value of flashvar parameter).

What I've done so far is

function clickRetryButton(){
  $("#board").attr('value', 'id={{ 1 }}'); 
}

This function changes value of the flashvar after the button is clicked. I wonder how can I refresh the flash object (so it's built from the beginning with a new flashvar)?

1 Answer 1

1

You can use cloneNode to copy the object, remove the old one and append the new one.

var old = document.getElementById("plist");
var new = old.cloneNode(true);
new.children[0].value = "id={{ 1 }}"; //change value of flashvar
//remove the old node from parent
//append the new node to parent
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.