Hello,

I made a website and embedded a flash gallery to display images.
In dreamweaver, to flash gallery shows up perfectly fine and beautiful. However, in any browser, it does not. Does not matter if the file is local or on a server, either.
It is however (discovered through firebug) downloading the *.swf file but for some reason, it wont display it.
for reference, the website is:
http://nimar-blume.de/galleries/landscape_g/

I hope some of you guys might know what is wrong.
thank you for your time!

yours sincerely,
replax

Dani AI

Generated

A concise expert note: the runtime failure reported by is consistent with the embed script trying to modify an element that either does not exist or is not yet available in the DOM; accessing the element's .style in that situation raises the TypeError. Also note that Flash is officially end‑of‑life and blocked by vendors, so migration to an HTML5 gallery is the longer‑term fix. Adobe Flash Player EOL. (adobe.com) (developer.mozilla.org)

Practical checklist (follow these in order):

  • Confirm the exact id used by the embed/registration call matches an actual element in the final HTML (case matters).
  • Inspect the DOM with browser devtools after load to ensure the element exists when the script runs.
  • Make sure the embed/init code runs only after DOM is ready (defer, move scripts to end of body, or run on DOMContentLoaded).
  • Avoid deleting the Dreamweaver/modified SWF script as a permanent fix: removing it may surface the SWF but disables the script's sizing/visibility handling (which explains the resizing problem noted by ). (developer.mozilla.org)

A safe minimal patch for the failing spot (illustrative) is to guard the DOM access and fall back to CSS insertion if the element is missing:

var el = document.getElementById(id);
if (el && el.style) {
  el.style.visibility = isVisible ? "visible" : "hidden";
}
else if (typeof createCSS === "function") {
  createCSS("#" + id, "visibility:" + (isVisible ? "visible" : "hidden"));
}

For robustness, replace Dreamweaver's modified file with the official SWFObject build (keeps cross‑browser checks and safer embedding). SWFObject on GitHub. (github.com)

On sizing: percentage heights (and max-height: 100%) are computed against the containing block’s height; if parent heights are not explicitly set, percent values are ignored — that often causes the 100% → max‑height math to fail. Either set explicit container heights or compute/set the plugin height with JS on resize. See CSS max-height behavior for details. (developer.mozilla.org)

Summary: the immediate fix is a null/existence check or swapping in the official SWFObject; the medium/long term solution is migration off Flash because browsers and vendors no longer support it. (adobe.com)

Recommended Answers

All 2 Replies

What's the URL of the gallery? Check if you've uploaded a copy of the folder "Scripts" onto your webserver. CS3 automatically create this folder/file to display Flash elements. This may be why it views ok locally (because they've automatically created it for you), but not online because you haven't copied it across.

hello,

thanks for your reply. in fact, i had the folder uploaded and managed to narrow the error down to swfobject_modified.js.

Uncaught exception: TypeError: Cannot convert 'getElementById(id).style' to object

Error thrown at line 484, column 3 in setVisibility(id, isVisible) in http://nimar-blume.de/galleries/landscape_g/Scripts/swfobject_modified.js:
    getElementById(id).style.visibility = v;
called from line 205, column 6 in main() in http://nimar-blume.de/galleries/landscape_g/Scripts/swfobject_modified.js:
    setVisibility(id, true);

the said function is:

function setVisibility(id, isVisible) {
  var v = isVisible ? "inherit" : "hidden";
  if (isDomLoaded) {
   getElementById(id).style.visibility = v;
  }
  else {
   createCSS("#" + id, "visibility:" + v);
  }
 }

upon deleting the said js file from the server, i see the flash object. however, it does not resize properly, it should be at 100% (set in the <obect> tag from the flash object) and then altered to have a max height of 100%-140px with css.

i hope that may help identifying the problem, as i a´m still clueless.

thank you for your time

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.