New version is out! The new version is 1.4, and there are only a few small changes/additions:
Changes:
- [updated] SWFObject.write() now returns true or false depending on whether the SWF content was written to the page or not (true if it is, false if it is not)
- [changed] The ‘com’ namespace has been removed, now everything lives in the ‘deconcept’ namespace only, instead of ‘com.deconcept’ namespace
- [updated] I made a couple of very small changes to get rid of warnings in the mozilla script debugger when the debugger was in strict mode
- added ‘the mark of the web’ to the examples pages to (hopefully) prevent the ActiveX bar from appearing at the top of the page when viewing these files locally in IE on Windows.
- [changed] And last, but certainly not least: FlashObject is now known as SWFObject because of legal reasons
The namespace change is significant if you are directly accessing any of the internal functions inside SWFObject, like the getPlayerVersion() call. This should be easy enough to modify. I’ve also left in the reference to ‘FlashObject’ so if you want to upgrade, but don’t want to update your HTML pages just yet, you should be able to just drop in the new swfobject.js file, update the references to that script, and your SWF files will still show up.
As for the name change: Yes, it has been a pain in the ass, but not as painful as I thought it would be. So far the renaming of the functions / documentations has only consumed a few hours. Changing the mailing list from FlashObject to SWFObject was a bit trickier, and I’m considering just moving it to Google groups instead of the current mailman setup I’m using now.
As for the overall effect of the renaming, I’ve come to think that it may actually be a good thing for SWFObject once the dust settles. There was a small blog blitz about the subject, which caused a small spike in traffic to the blog, which will probably just end up informing more people about the script. Current users will have a few small changes when they want to upgrade to the newest version, but it’s nothing that will take a huge amount of time. And since I was in Toronto at FITC when it happened, I had the chance to hang out with a few Adobe people and discuss the issue with them. They all agreed that it wasn’t really a good thing, but that there’s no reasoning with that feral beast that is the Adobe Legal Team®™.
I do, however, have concerns for other open source projects out there with the word “Flash” in the name. For them, changing names may not be so easy.
As for an update on the entire “using the word Flash” situation, Adobe (I’m told) is working on a response to everything, so hopefully in the next couple of weeks we’ll get a more comprehensive official statement from them that will clarify any outstanding questions.
UPDATE: As always, you’ll probably get a faster response to your support questions if you join and mail the SWFObject mailing list instead of mailing me directly.
This is pure genius, just the sort of SEO Flash trickery I’ve been looking for!
swfobject is great indeed.
it would be greater in a future version, if the swfobject just detect de size of the swf, and interact with the browser telling the progress bar the amount of bytes remaining to load the swf. of corse we allways can put a «progress bar» in the swf…
other thing is that anoying method ‘express install’. I must agree that M$ made a better thing now, it says instantly that user just need to install that ‘activex’, and installs quick…but only with the old fashion method of object embeded in html.
I think that will not be such dificult to do that in js. if I know how, I would make it, but I just dont program in js.
Anyone else unable to run FScommand with it?
I’ve had a few people tell me that it hasn’t detected their Flash 8. This time they were on pc’s. For me it seems to work fine. I’d be happy to email the fla’s incase I’ve made a mistake. Or is it possible to tell from your end if it seems to work ok from your perspective. Thanks. I love Flash but I’m not too confident with my ability to do this correctly when those small few have mentioned the detection issue on my site. Thanks.
k nevermind myproblem… I forgot you had to name the FScommand function according to the ID of the movie… stupid me :)
Pingback: testanchor385
On use of swfObject with ExternalInterface with IE:
If you set the “movieName” to be the same as the div id, then when you try to call a function in flash using the ExternalInterface, you get the following error in IE:”Object doesn’t support this property or method”.
e.g.This WILL give IE error:
flashMovie = document.getElementById(“flashcontent”);
flashMovie.myFlashCallbackFunction();
….
Using a different movie name as follows resolves the issue:
flashMovie = document.getElementById(“myMovieName”);
flashMovie.myFlashCallbackFunction();
….
It took me ages to find my simple mistake. The problem code worked fine in Firefox, just raised that error in IE (IE6 on WinXP). Hope this helps anyone else losing hair over the issue.
Thanks Geoff.
Oops, previous comment code didn’t come out right. Apologies. Where my above comment says “This is a test”, there should be the standard div code with the id “flashcontent” (in both examples).
swfObject is a blessing!!!, I have one comment. One of my coworkers noticed that several drop down menus using layers were being overlapped by the swfObject. He modify your javascript by adding , and the problem was solved.
I skiped what he added: <param name=”wmode” value=”transparent” /></param>
sorry, I cannot add the script, is bitting all the tags.
Juan: You don’t need to add anything to the js code to do that, you just need to add the parameter like you would any other parameter:
so.addParam("wmode", "opaque");(or ‘transparent’)Does anyone know if there is a similar method for java applets?
Or would it be to hard to do something simiral? I really dont have to much experience with javascript.
Thanks.
Hi !
I have a problem with textfield, when i put an swf on web via swfobject function, i just cant tape an @ inside my textarea, and when i publish the same swf, but with the good old
Sorry to ask my question again but i’m afraid it wasn’t read because of all those trackbacks… !
(my question was about the @ letter in textarea)
Thanks a lot !
I’ve added the feature so that you can have a minimum width and height of the window. i.e. If your movie width & height is 100% and the window is too small for you, this will add the scrollbars and fix the movie to the set size.
My javascript is a bit basic (sorry) but it seems to work, can you guys test it as well and see what you think?
The .js file is here.
You can use it like this:
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "100%", "100%", "7", "#336699");
so.addMinSize("500", "400");
so.write("flashcontent");
</script>
Psyche: I’m not sure what it could be. You could try sending your information to the SWFObject mailing list, (put together a test page first so we can look at it).
Tony: Sounds cool, but I think I prefer to control stuff like that in the stylesheet of the page.
Geoff: I didn’t know you could do that in css and so easily too. You learn something new every day, cheers.
does anyone know if swfObject is supposed to work on mac os 9 ? on Internet Explorer 5 it shows nothing (JS is enabled)
I don’t know anyone with an OS 9 machine to test it on, so I have never tested it on that. It does work in ie5 on OS X, though.
Since IE5 is a dead browser, and OS 9 is also a dead OS, I don’t plan on making it compattible unless the fix is something very simple that doesn’t add much size to the swfobject.js file.
Okay, i found why my “@” won’t appear. It seems that textfields go crazy when wmode is set to “transparent” (or “opaque”), running on firefox. The only way i found to avoid this mysterious thing is simply not to use wmode when using textfields :P
If anyone got an idea :/
Any plans to code this awsome script as straight asp?
Updated my XP and all the sites i used this in turned for flash turned up with nothing anymore
this is just great, Geoff!
thanks a lot and keep up your good work!
Really i have been changing my swf through embeded code for like 3 yrs now, Why is this called new update? geezz! u can do that by just using wmode! damn yo! lol!
Is it possible to pass a url into the flash movie using swfobject which also contains name/value pairs? For example
so.addVariable(“forwardTo”, “http://www.example.com/?name=value&name=value”); At the momemt the flash movie only gets this much http://www.example.com/?name=value so is there a way to get round the problem of passing the & character?
Yes, but the Flash Player will think that the
&signs are the start of a new variable, so you have to escape them – change them to%26or just use this instead:so.addVariable("forwardTo", encodeURIComponent(“http://www.example.com/?name=value&name=value"));I’m new to Flash and have found this very helpful… but I only have Flash MX 2004 and not version 8 and tried open the so_tester.fla but it says “Unexpected file format” I assume that this file is a version 8 file. Can someone provide a version which will work in MX 2004?
Hi there, Geoff
I downloaded SWFObject1.4 to use in a hybrid site. While testing in Flash 7 in Firefox 1.0, I came across a small error when embed tags are written. This line (62 in the download version):
for(var key in _1a){_19+=[key]+”=”"+_1a[key]+”" “;}
does not write the attributes correctly. The [] around the first reference to ‘key’ should be omitted. EMBED tags asre written correctly after this change was made:
for(var key in _1a){_19+=key+”=”"+_1a[key]+”" “;}
Just giving you the head’s up. Great work!
Good catch – not sure why nobody caught that before. The dojo shrinksafe added the brackets in, so I’ll be sure to report that as a bug to them.
I Just updated it in the 1.4.2 build, and will update that zip in a few minutes.
Also: I’m closing the comments on this post, if you need to comment on a bug, please remember to use the SWFObject mailing list instead.