Changing Width of a Object tag IE X FF

Posted on 2010-01-11
Medium Priority
Last Modified: 2012-05-08
Hi there

I'm trying to change the original Width of a Flash Object directly from the Flash itself calling
getURL("javascript:document.getElementById('r_banner').width='100%'; void(0);");

That works great on IE but nothing happens on FF.

The reason I need to change it on the fly its cuz our page is a "pre manufactured" page wich give us lack of resources and a simple change to the banner to accept 100% width will costs us like $1.000 wich is annoying.

If you guys want to try it directly here is the link:
This is the result constructed Flash Tag:

<span class=index_texto><div style="text-align: center">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" id="r_banner" name="r_banner" width="701" height="192">
	<param name="menu" value="false" />
	<param name="id" value="r_banner" />
	<param name="name" value="r_banner" />
	<param name="src" value="../imagens/banners/dermadoctor_banner.swf" />
	<param name="width" value="701" />
	<param name="height" value="192" />
	<embed type="application/x-shockwave-flash" "align="abscenter" allowscriptaccess="sameDomain" quality="high" menu="false" id="r_banner" name="r_banner" src="../imagens/banners/dermadoctor_banner.swf" width="701" height="192"></embed>

Thanks for the support,


Open in new window

Question by:furmiga
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 11

Expert Comment

ID: 26282121
try affixing width:100% in <div style="text-align: center">

Author Comment

ID: 26282202
Hi there

Here is the Thing:

I can't change the HTML since we are not the developers, we just bought the rights to use it.
So, basically, I want to change the HTML on the Fly, by using my own banner to do it.
I want my central banner to be a 100% width banner, wich in my Administrator Page I can't set it due to the tool provided.

So what can we do using our friend Javascript to accomplish this task? Is it possible?

Srry about my english - Brazilian here.

LVL 11

Expert Comment

ID: 26282450
this could be done only if you have access to the code :( atleast you must have access to the aspx page ..
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 26282542

I'm just wondering why in IE my javascript works and why not in FF
The original banner width is 701px wich came with the original HTML.

FFBug tells me that my Script successful changed the Object tag but not the internal param width or the embed tag width, wich remains at 701px

Is there another approuch to change those parameters?


Accepted Solution

furmiga earned 0 total points
ID: 26282727
Hi there!


Just had to add a call to the embed tag directly.

getURL("javascript:document.getElementById('r_banner').width='100%'; void(0);");
getURL("javascript:document.embeds['r_banner'].width='100%'; void(0);");

those solved my problem in both IE and FF

Thx anyway

LVL 11

Expert Comment

ID: 26283916
That Sounds Good !

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question