User avatar
EarlyOut
Posts: 1705
Joined: Sun Nov 11, 2007 9:22 pm
Location: Sector R
Contact: Website

Problem with Flash

I'm trying to incorporate the Flash display into my JAlbum skin software, and have run into two odd little problems.

If I use both swfobject.js and easing_equations.js, the Flash display isn't centered properly in the popup window in Firefox: [test site removed]. On this page, the regular images work fine, but the third one shows the error.

That same page in IE7 shows the Flash presentation properly, but the floating "Tina glatt" text doesn't move. In effect, the Flash presentation becomes a static image. It works OK if the Flash presentation is the first thing you open on the page, but if you open one of the other regular jpg's, then open the Flash again, it's static.

If I remove the call to the easing equations, it behaves properly in Firefox, but the IE7 problem seems to occur even without the easing equations, so I don't understand what's happening there, at all.

Any ideas?
Last edited by EarlyOut on Mon Apr 14, 2008 3:50 am, edited 1 time in total.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

I can't see anything wrong immedieatly with your pages, and I think these Firefox/IE7 issues are two different things, since they not seem related. Do you mind letting the page live for some days, so I can come back and check it in detail?
User avatar
EarlyOut
Posts: 1705
Joined: Sun Nov 11, 2007 9:22 pm
Location: Sector R
Contact: Website

I agree - at first, I thought the FF and IE7 problems were both indications of the same thing, but the more I played with it, the more it appeared they were different.

No problem with the page staying live for a while. I'll keep messing around with it, and will post back if I stumble on anything interesting.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

I found the Firefox related bug. Firefox is not able to handle the decimal values that are the result of certain easing operations. The fix is to simply round the numbers. It will be included in the next release. Until then,

Replace this:

Code: Select all

hs.setStyles(this.mediumContent, { left: (this.x.min - to.x) +'px', 
				top: (this.y.min - to.y) +'px' });
with this:

Code: Select all

hs.setStyles(this.mediumContent, { 
				left: Math.round(this.x.min - to.x) +'px', 
				top: Math.round(this.y.min - to.y) +'px' 
			});
This only applies to the configs using Highslide HTML.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

The fix for the stopping flash is to set hs.preserveContent = false. You can do this for either the whole page or the single Flash expander. If it is not false, IE stops it on close and it doesn't start again.
User avatar
EarlyOut
Posts: 1705
Joined: Sun Nov 11, 2007 9:22 pm
Location: Sector R
Contact: Website

Oh, you are good! Yes, those two changes appear to have taken care of the weird behaviors in FF and in IE. Thanks!
User avatar
EarlyOut
Posts: 1705
Joined: Sun Nov 11, 2007 9:22 pm
Location: Sector R
Contact: Website

Some related issues...

Usually with SWFObject, you can specify either the height and width, or specify a percentage, like:

var so = new SWFObject("Flash.swf", "my-flash", "100%", "100%", "7", "#FFFFFF");

That doesn't work in this context, however - the HS popup ends up being the wrong size.

Similarly, in your bare-bones example, if I change the height and width from 300/250 to 600/500, the height is correct, but the width is chopped off.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

I don't think percentages will work very well in this setting. The size of the Highslide wrapper is determine after the Flash. But, as you raise the width of the Flash to 600, you also have to raise the with of the expander itself, by using CSS or hs.width.
User avatar
EarlyOut
Posts: 1705
Joined: Sun Nov 11, 2007 9:22 pm
Location: Sector R
Contact: Website

Yes, I had a gut feeling that percentages would create horrendous problems with determining the size of the expander! For setting the width of the expander, hs.width works very nicely.

Now, I need to figure out how to determine the size of a Flash presentation. Something tells me that's going to be ugly, and full of land mines. Probably best to tell the users of my software that they need to pick a size, and let Flash use it, no matter what the "native" size of the SWF object is.
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Apparently there are PHP libraries to get the native dimensions of a flash movie.

Googling http://www.google.no/search?q=php+get+flash+width returns some hits, for example http://forum.mambo-foundation.org/showthread.php?t=9755

Return to “Highslide JS Usage”