Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:28:35+00:00 2026-06-02T16:28:35+00:00

I have the following simple object embed for Flash: <object id=siwp_obj type=application/x-shockwave-flash data=button.swf?file=%2F/ex.php?id=89804c7326e92a00c5c88c181190af8159cf060b height=32

  • 0

I have the following simple object embed for Flash:

<object id="siwp_obj"
        type="application/x-shockwave-flash" 
        data="button.swf?file=%2F/ex.php?id=89804c7326e92a00c5c88c181190af8159cf060b"
        height="32" width="32">
    <param id="siwp_param" name="movie"
           value="button.swf?file=%2F/ex.php?id=89804c7326e92a00c5c88c181190af8159cf060b" />
</object>

What I want to do is replace the id parameter with a new ID that is generated by the browser.

I’ve tried this, which works in Firefox but not in Chrome or IE9. Firefox successfully updates the parameters so the Flash object references the new ID, but Chrome and IE9 don’t update ID, or result in any script errors or warnings.

var cid = "randomstring";
var obj = document.getElementById('siwp_obj');
// get the "data" attribute which contains the URL with an old id to replace
obj.setAttribute('data', obj.getAttribute('data').replace(/[a-zA-Z0-9]{40}$/, cid));

obj = document.getElementById('siwp_param');
obj.value = obj.value.replace(/[a-zA-Z0-9]{40}$/, cid);

I’m trying to assume no javascript libraries are available since this will be used in a plugin system.

Does anyone have any ideas on how to update the URLs for the object and param tag dynamically?

EDIT:

In Chrome, I did some debugging and noticed that the parameter is being updated, but when I interact with the flash, it hasn’t been reloaded.

For example:

var obj = document.getElementById('siwp_obj');
alert(obj.getAttribute('data')); // the old URL with old ID
obj.setAttribute('data', obj.getAttribute('data').replace(/[a-zA-Z0-9]{40}$/, cid));
alert(obj.getAttribute('data')); // the new URL with new ID

…But when I click on the flash object to try to stream from the new URL, it still refers to the old URL with the old ID. So the DOM is being updated, but the browser is then missing the fact that some parameters to the object have changed. Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:28:37+00:00Added an answer on June 2, 2026 at 4:28 pm

    I was able to get it working by updating the dom elements, and then creating a clone and replacing it in the document.

    This works in IE6+, Firefox, and Chrome (haven’t tested in any others yet).

    // update object and param tag with new id
    var obj = document.getElementById('siwp_obj');
    obj.setAttribute('data', obj.getAttribute('data').replace(/[a-zA-Z0-9]{40}$/, cid));
    var par = document.getElementById('siwp_param'); // this was a comment...
    par.value = par.value.replace(/[a-zA-Z0-9]{40}$/, cid);
    
    // replace old flash w/ new one using new id
    // clone the original object tag and then insert the clone, remove the original
    var newObj = obj.cloneNode(true);
    obj.parentNode.insertBefore(newObj, obj);
    obj.parentNode.removeChild(obj);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following simple methods for writing a python object to a file
I have the following simple xml object file: [AuthorList] => SimpleXMLElement Object ( [@attributes]
I have the following simple class Data annotation to control the area of phone
I have the following simple button with an image as the template. The problem
Hi i have created a simple menu in Flash. I have added the following
I have the following simple code for an object that holds a weak reference:
I have the following simple javascript function to slide an object up and down.
I have the following simple application page that uses the phone camera to upload
In my application I have the following message: Object reference not set to an
I am currently learning WPF (C#) and have taken the following simple data binding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.