View Full Version : Javascript causes screen to flicker

Jun 13th, 2008, 10:23 AM
I don't really have an example I can show, but for some reason whenever I try to update a div with a countdown from a set number, it appears to cause a windows media player embed that I have embedded on the same page to flicker on and off.

<OBJECT id='mediaPlayer' width="320" height="285"
standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
<param name='fileName' value="http://www.bordergatewayprotocol.net/jon/humor/video/FamilyGuyTruth.mpg">
<param name='animationatStart' value='true'>
<param name='transparentatStart' value='true'>
<param name='autoStart' value="true">
<param name='showControls' value="true">
<param name='loop' value="true">
<EMBED type='application/x-mplayer2'
id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
bgcolor='darkblue' showcontrols="true" showtracker='-1'
showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
src="some.wmv" autostart="true" designtimesp='5311' loop="true">

<br /><br />
<div id="testing">0</div>
<script type="text/JavaScript">
function update(){
document.getElementById('testing').innerHTML=parseInt(document.getElementById('testing').innerHTML)+ 1;
That's just a mockup I did to give a better idea (http://hobohost.prophp.org/index.html).

I couldn't get the test to appear as close to what I have in my test development, but is there a way to avoid this flickering - is there a set command for media player or a workaround to stop or reduce the flickering (besides increasing the settimeout counter)?

Jun 13th, 2008, 12:42 PM
My screen doesn't flicker in FF or IE6. Maybe your comp is slow or something.

Jun 13th, 2008, 01:04 PM
mine dosent in IE7 - it might just be lack of ram for javascript to run so it is using swap so it is slower

Jun 13th, 2008, 05:51 PM
I was trying to replicate the problem but the example I posted works fine for me. Perhaps I should try bogging it down to see whether it's my own problem or whether it was a JC flickering problem.

BTW I witnessed the problem only in Firefox. And after the counter stops, it stops flickering.