/    Sign up×
Community /Pin to ProfileBookmark

getelementbyID problem

Hi,

I know IE and Firefox work differently but is there any way around this problem:

I have the Flash code below and I call script to change the Flash src so a different flash is shown. The problem is in Firefox this works and in IE I get an error stating “moviesrc2” is null or not an object. This works fine in FF. Any ideas?


————————————————

<object id=”FlashID” classid=”clsid?27CDB6E-AE6D-11cf-96B8-444553540000″ width=”740″ height=”424″>
<param id=”moviesrc1″ name=”movie” value=”../../flash/world.swf”>
<param name=”quality” value=”high”>
<param name=”wmode” value=”opaque”>
<param name=”swfversion” value=”6.0.65.0″>
<!– This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. –>
<param name=”expressinstall” value=”../../Scripts/expressInstall.swf”>
<!– Next object tag is for non-IE browsers. So hide it from IE using IECC. –>
<!–[if !IE]>–>
[B]<object name=”moviesrc2″ id=”moviesrc2″[/B] type=”application/x-shockwave-flash” data=”../../flash/world.swf” width=”740″ height=”424″>
<!–<![endif]–>
<param name=”quality” value=”high”>
<param name=”wmode” value=”opaque”>
<param name=”swfversion” value=”6.0.65.0″>
<param name=”expressinstall” value=”../../Scripts/expressInstall.swf”>
<!– The browser displays the following alternative content for users with Flash Player 6.0 and older. –>
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href=”http://www.adobe.com/go/getflashplayer”><img src=”http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif” alt=”Get Adobe Flash player” width=”112″ height=”33″ /></a></p>
</div>
<!–[if !IE]>–>
</object>
<!–<![endif]–>
</object>


————————————————

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@BIOSTALLApr 18.2010 — Do you have your Javascript code?
Copy linkTweet thisAlerts:
@danpalmervwareauthorApr 18.2010 — sure:

document.getElementById('curtain').style.display= "block";
document.getElementById('world').style.display= "block";
document.getElementById('moviesrc1').value = "../../flash/"+b+".swf";
document.getElementById('moviesrc2').data = "../../flash/"+b+".swf";
document.getElementById('myspeed').style.display= "none";
×

Success!

Help @danpalmervware spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...