Bloody excellent. Thanks guys :)

On Jan 21, 11:47 am, "Aran Rhee" <[email protected]> wrote:
> Bobby.
>
> Re: being dirty - I don't know, it just felt a bit wrong to be doing
> checking in this way. I guess I am used to having a version static I can get
> to :) (Flash components / frameworks etc)
>
> Unfortunately your code below throws an error: 'deconcept' is undefined, if
> you try using a swfobject.js != 1.x.
>
> V 0.3:
>
> <script type="text/javascript">
>         function swfobjectVersionTest()
>         {
>                 if (typeof deconcept=='object' && deconcept!=null) { return
> 1; }
>                 else if (typeof swfobject=='object' && swfobject!=null) {
> return 2; }
>             else { return 0; }
>         }
>
>         var v = swfobjectVersionTest();
>         alert(v);
> </script>
>
> Aran
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
>
> Behalf Of Bobby
> Sent: Wednesday, 21 January 2009 10:18 PM
> To: SWFObject
> Subject: Re: which version of swf object is being used
>
> Web authors usually know which version they code against, so checking
> if the namespace/object exist looks fine to me (why is it dirty any
> way?)
>
> Just remember that typeof null also returns 'object', so you could may
> better check for:
>
> <script type="text/javascript">
>         function swfobjectVersionTest() {
>                 if (deconcept) { return 1; }
>                 else if (swfobject) { return 2; }
>                 else { return 0; }
>         }
>         var v = swfobjectVersionTest();
>         alert(v);
> </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to