473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flash, Javascript Time Conflict in Internet Explorer

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
13 5277
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
9396
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
0
762
by: Drew D. Saur | last post by:
When working on a web site for my employer, I uncovered what appears to be an undocumented bug in Internet Explorer 5 & 6 for Windows in regard to a (perhaps uncommon?) integration of Flash...
18
12636
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
2
1706
by: Oz Kologlu | last post by:
Hi folks, IE and Asp.net 2.0 are doing some pretty bizzare things. Some of our users were getting pretty weary of IE redrawing and "flashing" what is essentially a pretty static page every time...
8
5871
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
5
5932
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to...
1
2382
by: skeem | last post by:
I am having issues viewing flash that has been inserted via javascript in Internet Explorer. I had to uninstall my flash about a week ago. I've since reinstalled flash and reinstalled flash player...
2
8047
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.