Closed GoogleCodeExporter closed 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
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
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
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
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
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
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
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
Cool, let's close this baby down!
Original comment by bobbyvandersluis
on 20 Mar 2008 at 8:57
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
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
[deleted comment]
[deleted comment]
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
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
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
Re comment 16: please read our FAQ
Original comment by bobbyvandersluis
on 13 Feb 2009 at 10:05
Thanks Bobby, sorted, I feel stupid now :)
Original comment by mrpetero...@gmail.com
on 13 Feb 2009 at 10:13
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
Original issue reported on code.google.com by
gz.yello...@gmail.com
on 16 Mar 2008 at 6:45