By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

Flash, Javascript Time Conflict in Internet Explorer

P: n/a
I have a webpage that has two flash animations running. I also have a
javascript script running that rotates 3 images and fades them in and
out. To do the fading and rotating in javascript I am using the
setInterval function, like this:

setInterval(function () {imageFade()},10);
This works fine in Firefox, but in IE 7, the flash animations slow
down a lot, and the javascript fading/rotation slows down some.

There seems to be a timing conflict in IE 7 between flash and
javascript. Any suggestions on how to fix this in IE 7?

Sep 28 '07 #1
Share this Question
Share on Google+
13 Replies


P: n/a
On Sep 28, 1:12 pm, "mud...@gmail.com" <mud...@gmail.comwrote:
I have a webpage that has two flash animations running. I also have a
javascript script running that rotates 3 images and fades them in and
out. To do the fading and rotating in javascript I am using the
setInterval function, like this:

setInterval(function () {imageFade()},10);
What does this imageFade function look like and why call it a hundred
times per second?

Sep 28 '07 #2

P: n/a
mu****@gmail.com wrote:
I have a webpage that has two flash animations running. I also have a
javascript script running that rotates 3 images and fades them in and
out. To do the fading and rotating in javascript I am using the
setInterval function, like this:

setInterval(function () {imageFade()},10);

This works fine in Firefox, but in IE 7, the flash animations slow
down a lot, and the javascript fading/rotation slows down some.

There seems to be a timing conflict in IE 7 between flash and
javascript. Any suggestions on how to fix this in IE 7?
One thing that might be happening is that calling your imageFade
function every 10 milliseconds isn't leaving enough time for everything
to run. You could try making some measurements. Make a note of the time
at the start of your imageFade and also at the end. You might find it's
close to 10ms. It's for this reason that I never use setInterval with a
short time. For me, if the time is less than a second, then I usually
prefer to use setTimeout, and put a setTimeout at the end of your
function for the next call. By using setTimeout, you're guaranteeing a
certain amount of "free time" until the next call. There's no perfect
solution, the browser environment is a controlled sandbox and things run
only as fast as allowed when the overhead of that environment being
managed is also accounted for.
Sep 28 '07 #3

P: n/a
mu****@gmail.com wrote:
I have a webpage that has two flash animations running. I also have a
javascript script running that rotates 3 images and fades them in and
out.
Ouch.
To do the fading and rotating in javascript I am using the
setInterval function, like this:

setInterval(function () {imageFade()},10);
No OS timer ticks in 10-millisecond intervals.
This works fine in Firefox, but in IE 7, the flash animations slow
down a lot, and the javascript fading/rotation slows down some.

There seems to be a timing conflict in IE 7 between flash and
javascript. Any suggestions on how to fix this in IE 7?
Don't use setInterval() for time-critical applications; use setTimeout()
instead. Google is your friend. [psf 6.1]
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 28 '07 #4

P: n/a
Thomas 'PointedEars' Lahn said the following on 9/28/2007 4:18 PM:
mu****@gmail.com wrote:
<snip>
>This works fine in Firefox, but in IE 7, the flash animations slow
down a lot, and the javascript fading/rotation slows down some.

There seems to be a timing conflict in IE 7 between flash and
javascript. Any suggestions on how to fix this in IE 7?

Don't use setInterval() for time-critical applications; use setTimeout()
instead.
You think that 2 flash apps animating and an image slide show is "time
critical"?
Google is your friend. [psf 6.1]
Are you referring to the same Google that can't figure out how to make
two statistics for the same thing match? Google isn't always your friend.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 28 '07 #5

P: n/a
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 9/28/2007 4:18 PM:
>mu****@gmail.com wrote:
>>This works fine in Firefox, but in IE 7, the flash animations slow
down a lot, and the javascript fading/rotation slows down some.

There seems to be a timing conflict in IE 7 between flash and
javascript. Any suggestions on how to fix this in IE 7?
Don't use setInterval() for time-critical applications; use setTimeout()
instead.

You think that 2 flash apps animating and an image slide show is "time
critical"?
If the frame length of the animation should be 10 milliseconds, yes.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 29 '07 #6

P: n/a
In comp.lang.javascript message <46**************@PointedEars.de>, Fri,
28 Sep 2007 22:18:51, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>
No OS timer ticks in 10-millisecond intervals.
That's rather a strong statement; are you sure that you know about EVERY
OS - or even every one that supports Javascript?

ISTR reading that the Win98/WinXP timer, while running by default at
64Hz, can be set by a program to run at other speeds; and that the new
speed will be maintained whilst that other program continues to run. I
don't assert that as a proven fact, though.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Sep 29 '07 #7

P: n/a
Dr J R Stockton wrote:
In comp.lang.javascript message <46**************@PointedEars.de>, Fri,
28 Sep 2007 22:18:51, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>No OS timer ticks in 10-millisecond intervals.

That's rather a strong statement; are you sure that you know about EVERY
OS - or even every one that supports Javascript?

ISTR reading that the Win98/WinXP timer, while running by default at
64Hz, can be set by a program to run at other speeds; and that the new
speed will be maintained whilst that other program continues to run. I
don't assert that as a proven fact, though.
OK, let's just say that I find it unlikely that any HTML UA ticks that fast
or that such low values are even implemented by setTimeout(). Given the
current Gecko code and the Bugzilla material found so far, I have to assume
that the earliest implementations already normalized the time value to
prevent the OS from hanging:

https://bugzilla.mozilla.org/show_bug.cgi?id=123273
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 29 '07 #8

P: n/a
Thomas 'PointedEars' Lahn said the following on 9/29/2007 3:39 PM:
Dr J R Stockton wrote:
>In comp.lang.javascript message <46**************@PointedEars.de>, Fri,
28 Sep 2007 22:18:51, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>>No OS timer ticks in 10-millisecond intervals.
That's rather a strong statement; are you sure that you know about EVERY
OS - or even every one that supports Javascript?

ISTR reading that the Win98/WinXP timer, while running by default at
64Hz, can be set by a program to run at other speeds; and that the new
speed will be maintained whilst that other program continues to run. I
don't assert that as a proven fact, though.

OK, let's just say that I find it unlikely that any HTML UA ticks that fast
Just as I find it unlikely that a web page with two Flash animations and
a JS image flickering thingie script would be "time critical". Nothing
more than third grade gimmicks is all it is.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 29 '07 #9

P: n/a
On Sep 28, 8:27 pm, "mud...@gmail.com" <mud...@gmail.comwrote:

[snip]
>
By default are there filters?
Not by default.

Sep 30 '07 #10

P: n/a
On Sep 29, 4:57 pm, David Mark <dmark.cins...@gmail.comwrote:
On Sep 28, 8:27 pm, "mud...@gmail.com" <mud...@gmail.comwrote:

[snip]
By default are there filters?

Not by default.
My question is, why does it work fine in Firefox and not in IE? How
can I make it work in IE too? I switched setInterval to setTimeout,
but there is not difference in performance in IE.

Oct 1 '07 #11

P: n/a
mu****@gmail.com wrote:
My question is, why does it work fine in Firefox and not in IE? How
can I make it work in IE too? I switched setInterval to setTimeout,
but there is not difference in performance in IE.
That would depend on the code you are using now, which you have not posted.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Oct 1 '07 #12

P: n/a
On Oct 1, 4:39 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
mud...@gmail.com wrote:
My question is, why does it work fine in Firefox and not in IE? How
can I make it work in IE too? I switched setInterval to setTimeout,
but there is not difference in performance in IE.

That would depend on the code you are using now, which you have not posted.

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
I posted it here: http://groups.google.com/group/comp....e5d1b88beb4a/#

Oct 2 '07 #13

P: n/a
On Oct 1, 4:39 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
mud...@gmail.com wrote:
My question is, why does it work fine in Firefox and not in IE? How
can I make it work in IE too? I switched setInterval to setTimeout,
but there is not difference in performance in IE.

That would depend on the code you are using now, which you have not posted.

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Thanks a lot for your help. I figured some stuff out. Like instead
of just calling setTimeout with 10 milliseconds, also call it with
4000 seconds for when I want a picture to stay there for awhile
without fading.

Oct 2 '07 #14

This discussion thread is closed

Replies have been disabled for this discussion.