Does anyone have experience using SWFObject (http://blog.deconcept.com/swfobject/) to embed flash? I have recently tried this method and have found that my page no longer displays as it should.
My original working site is at: http://www.nzography.com/.
It uses the Flash 8 publishing method to detect flash version and embed the swf. You can see that the black square is in the top left corner of the screen, and the map is centered.
My attempt at using SWFObject resulted in this: http://www.nzography.com/v2/.
This works fine in IE, but in Firefox you’ll see that the black square is no longer in the right place (if your screen is small you won’t see it at all!) and the map is not centered.
In both examples the exact same SWF file is used. For both the “salign” is set to top left. And they are both set to noscale.
The only difference I can see is the embed method, and the SWFObject method is not working properly! Any ideas of what could be causing this? It looks to me like it must be one of three things:
The salign isn’t working properly
The scale=“noscale” is not working
The flash code is not properly reading stage width and height
Couldn’t really tell ya. Im not sure why the swf would position it self any differently in IE than FF.
Maybe there is some conflicting CSS stuff going on.
Maybe try taking out this.
Thanks for the info. I did not realize that those parameters could be set within AS. So, as a new question, how do I set these parameters using AS?
Anyone else have an idea about why FF is displaying this differently than IE? This is driving me nuts because I really want to use SWFObject but it’s not worth it if it doesn’t display the site correctly!
It definitely not a bug in the swfObject. I have been using it for a long time now and never had this problem. It’s just bad code on your part. No offense
The odd thing is, whether its bad code or an SWFObject bug, is that it works fine when using the flash 8 publishing method. So I don’t see why anything would change when switching publishing methods. It’s the same SWF file.
glosrfc, thanks for your feedback. I did try “tl” instead of “lt” and they both had the same effect. But I will go back and mess around with the parameters some more and see if I can’t get them working.
The code is up above…right-click on the page like I did
I’m pretty sure it’s down to incorrect usage of so parameters…although it is confusing that the Stage class has some properties that aren’t allowed as parameters, such as noscale
Thanks again to both of you guys. I got it working. I removed all of the params from the html, and just put this in AS:
[AS]
Stage.scaleMode = “noScale”;
Stage.align = “TL”;
Stage.showMenu = false;
[/AS]
It was putting the align param in AS rather then html that solved it.
Are you sure? Here’s a quote from the SWFObjects page:
SWFObject is a small Javascript file used for embedding Macromedia Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents*, and is forward compatible, so it should work for years to come.
Sounds like cross browser to me. It’s working now for me in IE and Firefox, so that’s good enough for me!