Internet Explorer and Flash

Page: 1

Author Post
bobhendren
Guest
Great new version! Been using Floatbox for a while and just saw that this version was released.

I'm working with direct loading Flash SWFs and most everything is OK. The only problem I'm seeing is that if I simply click the 'close' on FB while the Flash is playing, the FB closes but the Flash sound continues in IE. It doesn't do it in Firefox, and it also doesn't do it on the Demo page here in IE. Is there a parameter that tells Flash to stop playing on FB close?
Administrator
Registered: Aug 2008
Posts: 3382
Hi bob,

That's odd behaviour. There's no parameter to stop the flash, but there's code that is supposed to always do that on end. It's a pretty aggressive approach. It removes the divs containing the flash element from the document and then deletes and discards all references to those divs. If that's not enough to make your flash shut up, I don't know what would be.

Since I can't reproduce this with my content, would you be willing to try an experiment for me? If you are, edit floatbox/modules/core.js. Find the following line (line #1644?):
t[id].parentNode.removeChild(t[id]);

Right before that line, insert a new line that says:
t[id].style.display = 'none';

Any joy?
bobhendren
Guest
No joy there...

You can see it in-place at http://www.listingware.com - there is a small video graphic right in the middle of the page. I'm running IE7 on Vista. The behavior that I'm seeing is that if you click the Close, it will cause the Flash to hesitate briefly, then the sound continues, but the FB shrinks away. About 1 try out of 10, it actually does quit - but more often, it just keeps on playing. Don't want to make users mad...
bobhendren
Guest
By the way, I've used both the floatbox.js and framebox.js scripts, to no avail. Figured they were both using the same core.js, though.
Administrator
Registered: Aug 2008
Posts: 3382
I think I've got something for you but it entails patching your core.js

In floatbox/modules/core.js, find the block of code (line #1620?) what says:
	setTimeout( function() {
if (t.fbContent) {
t.fbMainDiv.removeChild(t.fbContent);
delete t.fbContent;
}
}, 20);

Surgically remove that block of code and replace with...
	if (item.type.indexOf('media') === 0) {
setTimeout( function() {
var objects = t.fbContent.getElementsByTagName('object'),
i = objects.length;
while (i--) {
var obj = objects[i];
if (obj && obj.parentNode) obj.parentNode.removeChild(obj);
}
}, 20);
}
...being careful not to damage any of the surrounding tissue.

This works for me. Let me know if it works for you too. Assuming this is a success, do you need compressed core.js files with this patch in it?
Administrator
Registered: Aug 2008
Posts: 3382
Bob,
I had to update the zip package because of a documentation error that was causing problems for some folks. I put this flash-closing change into the new zip package and posted it on the download page just now. You can mod core.js as described in my post, or grab the new zip as you see fit. The advantage of the zip file is the change is made in the compressed files too.

Cheers...
bobhendren
Guest
Why thank you, Doctor! The transplant seems to be a success! The patient is healing nicely...

Page: 1