...

View Full Version : Javascript causes screen to flicker



BatCountry
06-13-2008, 09: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.

<center>
<OBJECT id='mediaPlayer' width="320" height="285"
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
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'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
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">

</EMBED>
</OBJECT>
<br /><br />
<div id="testing">0</div>
<script type="text/JavaScript">
function update(){
document.getElementById('testing').innerHTML=parseInt(document.getElementById('testing').innerHTML)+ 1;
setTimeout('update()',1000);
}
update();
</script>
</center>
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)?

hotwheelharry
06-13-2008, 11:42 AM
My screen doesn't flicker in FF or IE6. Maybe your comp is slow or something.

barkermn01
06-13-2008, 12: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

BatCountry
06-13-2008, 04: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum