[SWFObject] restricting cleanupSWF to SWF only

Geoff Stearns geoff at deconcept.com
Mon Sep 18 12:24:58 PDT 2006


this is interesting... the classid seems like a quick solution...

another one might be to insert a custom class name into each object  
tag and then check for the class name before removing it.

I think the check for classid might be smaller size, though, so maybe  
i'll add this into the 2.0 code and do some tests.

anyone from adobe want to chime in on the classid ever changing in  
the future? seems like it wouldn't be a very good idea, but i know  
that windows media player changed their classid when they went from  
v6.4 to the next one up...

not really sure why though.



On Sep 18, 2006, at 2:30 PM, David de Kock wrote:

>
> In my application I'm mixing flash, wmv and qt player in the same page
> and I've noticed that on unload the cleanupSWFs also cleans my WM  
> and QT
> objects. I've added one line to the cleanupSWFs function to check  
> if the
> object is Flash before cleaning up starts. I'm checking for the  
> specific
> flash classid value by the way.
>
> Here is my version of the function:
>
> deconcept.SWFObjectUtil.cleanupSWFs = function() {
>   if (window.opera || !document.all) return;
>     var objects = document.getElementsByTagName("OBJECT");
>     for (var i=0; i < objects.length; i++) {
>       if (objects[i].classid ==
> "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000") {
>         objects[i].style.display = 'none';
>         for (var x in objects[i]) {
>           if (typeof objects[i][x] == 'function') {
>           objects[i][x] = function(){};
>         }
>       }
>     }
>   }
> }
>
> I wonder if checking for classid is the smartest? This should be  
> unique
> but I don't know if the classid values are likely to change when new
> flash versions in the future.
>
> Thanks,
> David
>
> PS. SWFObject rocks!
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.12.4/449 - Release Date:
> 15-9-2006
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list