windbreakerdoss / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

Redraw issue on FireFox for MacOs X. #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Please find below my environment details:
- Operating system: MacOs X 10.5.2
- Processor:2.4 Ghz Intel Core 2 Duo
- Memory: 4 GB 667 Mhz DDR2 SDRAM
- Browser: FireFox: 2.0.0.12
- Flash Player: 9,0,115,0
- Sample: http://magic.yellowtip.com/lhc2/index.php

Steps to reproduce:
1. Point your browser to the sample page. You will notice a Flash slideshow
on the homepae.
2. Click on any link to go into the website.
3. Click on the "Laguna Holiday Club" logo in the upper left corner to go
back to the home page.

You will notice that the Flash area is now white. When clicking with the
mouse on the area, the Flash animation suddenly shows.

What is expected is that the Flash area always shows the flash animation.
Showing the Flash area as white is incorrect behavior.

On the same computer, the above problem cannot be reproduced with Safari 3.0.4.

Original issue reported on code.google.com by gz.yello...@gmail.com on 16 Mar 2008 at 6:45

GoogleCodeExporter commented 9 years ago
Thanks for the test page, we investigate it.

Some initial comments:

Testing the sample page on:
- Mac OS X 10.4.11 PPC
- Firefox 2.0.0.12
- Flash Player 9.0.47
everything works ok. So this looks like a more specific issue.

When validating the code of the web page, a huge amount of errors is returned, 
of
which most are probably not severe, but it does include nesting errors, which 
you
might want to check out, because these details can  cause all kinds of errors.

Being pragmatic, a question, I just wonder if you force the focus on the Flash
element by code, using something like the following, does it solve your issue:

swfobject.addLoadEvent(fousMe);

function focusMe() {
  document.getElementById("lhcFlash").focus();
}

Original comment by bobbyvandersluis on 17 Mar 2008 at 10:44

GoogleCodeExporter commented 9 years ago
And upgrading the previous described setup to fp 9.0.115 doesn't make a 
difference.

Testing the sample page on:
- Mac OS X 10.4.11 Intel
- Firefox 2.0.0.12
- FP 9.0.115
I can reproduce the issue. When focusing the SWF or resizing the browser window 
the
Flash content suddenly gets visible.

So this may point at an Mac OS X + Firefox + Intel specific issue.

Could you please solve the validation errors in your example, so we have a 
clean test
case and we know for sure that the test case itself isn't responsible for thee 
issue?

Original comment by bobbyvandersluis on 17 Mar 2008 at 10:57

GoogleCodeExporter commented 9 years ago
Hi Bobby,

Thank you very much for your fast response.

I have cleaned up the html code of the home page and it is now validated 
correctly by the w3.org validator. 
This did not however solve the problem.

Next, I added your 'focusMe' code. This DOES seem to solve the problem, but now 
FireBug shows the 
following error:
fousMe is not defined
[Break on this error] swfobject.addLoadEvent(fousMe);

I know next to nothing about Javascript, so is there any way I can solve this 
firebug error?

Thank you very much in advance!

Original comment by gz.yello...@gmail.com on 18 Mar 2008 at 12:46

GoogleCodeExporter commented 9 years ago
Oops, typo from my side, fousMe should be focusMe:

swfobject.addLoadEvent(focusMe);

function focusMe() {
  document.getElementById("lhcFlash").focus();
}

Original comment by bobbyvandersluis on 18 Mar 2008 at 9:49

GoogleCodeExporter commented 9 years ago
Everything is written correctly to the DOM, so still I think this is a 
Firefox/OS
X/Intel rendering issue, there is not much we can do about it with SWFObject.

Please let me know if the focus trick works, then at least we have a good 
workaround.

Original comment by bobbyvandersluis on 18 Mar 2008 at 10:23

GoogleCodeExporter commented 9 years ago
Very funny, after I corrected fousMe -> FocusMe, the workaround stopped 
working! When
using fousMe, while getting a Javascript error, the Flash behaves correctly.

Do you have any idea why?

Thanks in advance.

Original comment by gz.yello...@gmail.com on 18 Mar 2008 at 10:39

GoogleCodeExporter commented 9 years ago
No, it's definitely a Firefox redraw bug, so you best look for a workaround that
forces Firefox to redraw. You could try something like the following (by 
setting the
display style property):

swfobject.addLoadEvent(forceRedraw);

function forceRedraw() {
  document.getElementById("lhcFlash").style.display = "block";
}

or add an empty DIV to the page:

swfobject.addLoadEvent(forceRedraw);

function forceRedraw() {
   var d = document.createElement("div");
   document.getElementsByTagName("body")[0].appendChild(d);
}

Does any of that work?

Original comment by bobbyvandersluis on 19 Mar 2008 at 10:20

GoogleCodeExporter commented 9 years ago
Bobby, thank you so much for your excellent support.

Your first solution does the trick!

I'd have to agree with you that this looks like a FF bug.

Thanks again!

Original comment by gz.yello...@gmail.com on 20 Mar 2008 at 8:02

GoogleCodeExporter commented 9 years ago
Cool, let's close this baby down!

Original comment by bobbyvandersluis on 20 Mar 2008 at 8:57

GoogleCodeExporter commented 9 years ago
I've the same problem on the front page of http://www.kirnauskis.com. Neither 
of 

function forceRedraw() {
  document.getElementById("lhcFlash").style.display = "block";
}

or add an empty DIV to the page:

swfobject.addLoadEvent(forceRedraw);

function forceRedraw() {
   var d = document.createElement("div");
   document.getElementsByTagName("body")[0].appendChild(d);
}

seem to work, any other solutions available?

Original comment by knuut...@gmail.com on 9 Oct 2008 at 9:56

GoogleCodeExporter commented 9 years ago
Works in FF3/mac for me, what's the issue and in which browser?

Original comment by bobbyvandersluis on 9 Oct 2008 at 12:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Just ran into this issue also. The forceRedraw hack works, however, it results 
in the
content flickering. (Firefox 3 only)

No problem on Safari.

No problem with regular embed method generated from Flash IDE.

Original comment by aralbal...@gmail.com on 26 Jan 2009 at 4:07

GoogleCodeExporter commented 9 years ago
Made a note about the workaround I used for my specific issue:
http://aralbalkan.com/1933

Original comment by aralbal...@gmail.com on 26 Jan 2009 at 4:52

GoogleCodeExporter commented 9 years ago
I'm not being able to get any of forceRedraw hacks to fix the problem here. The 
flash
container's height is always stuck on 0.

I'm on mac, FF 3.0.6. In Safari it works fine.

Any suggestions?

Here's my full javascript in the html head:

swfobject.addLoadEvent(forceRedraw);

function forceRedraw1() {
    document.getElementById("lhcFlash").style.display = "block";
}
function forceRedraw2() {
    var d = document.createElement("div");
    document.getElementsByTagName("body")[0].appendChild(d);
}
function forceRedraw3() {
    document.getElementById("lhcFlash").focus();
}

// due to a bug with flash stage.stageWidth/Height initially returning 0, a
workaround is too pass in the width and height via flashvars
var browserViewportWidth;
var browserViewportHeight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use
// window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined') {
    browserViewportWidth = window.innerWidth, browserViewportHeight = window.innerHeight
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line
// in the document)
else if (typeof document.documentElement != 'undefined'
        && typeof document.documentElement.clientWidth != 'undefined'
        && document.documentElement.clientWidth != 0) {
    browserViewportWidth = document.documentElement.clientWidth,
            browserViewportHeight = document.documentElement.clientHeight
}
// older versions of IE
else {
    browserViewportWidth = document.getElementsByTagName('body')[0].clientWidth,
    browserViewportHeight = document.getElementsByTagName('body')[0].clientHeight
}

var flashvars = {};
flashvars.browserViewportWidth = browserViewportWidth;
flashvars.browserViewportHeight = browserViewportHeight;
var params = {};
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "lhcFlash";
swfobject.embedSWF("MySwf.swf", "myAlternativeContent", "100%", "100%", "9.0.0",
"expressInstall.swf", flashvars, params, attributes);

Original comment by mrpetero...@gmail.com on 13 Feb 2009 at 8:43

GoogleCodeExporter commented 9 years ago
Re comment 16: please read our FAQ

Original comment by bobbyvandersluis on 13 Feb 2009 at 10:05

GoogleCodeExporter commented 9 years ago
Thanks Bobby, sorted, I feel stupid now :)

Original comment by mrpetero...@gmail.com on 13 Feb 2009 at 10:13

GoogleCodeExporter commented 9 years ago
The issue in comment #10 was fixed using the following:

function forceRedraw() {
document.getElementById("flashfix").style.display = "inline";
}
swfobject.addLoadEvent(forceRedraw);
</script>

Flashfix is the name of the div where the swf file is located.

Original comment by knuut...@gmail.com on 3 Mar 2009 at 12:38