Permalink
Browse files

Issue 133: Now also detects Flash versions 6 and above. Important fix…

… since 6.79 is the default version in XP
  • Loading branch information...
1 parent d90851f commit a128c0e6f74a88f2b4a4d2a91884bd38d37776f8 @tipiirai tipiirai committed Aug 17, 2010
Showing with 31 additions and 4 deletions.
  1. +8 −4 src/toolbox/toolbox.flashembed.js
  2. BIN test/toolbox/clock.swf
  3. +23 −0 test/toolbox/flashembed.htm
View
12 src/toolbox/toolbox.flashembed.js
@@ -88,17 +88,21 @@
conf: GLOBAL_OPTS,
getVersion: function() {
- var ver;
+ var fo, ver;
try {
ver = navigator.plugins["Shockwave Flash"].description.slice(16);
} catch(e) {
try {
- var fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
- ver = fo && fo.GetVariable("$version");
+ fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+ ver = fo && fo.GetVariable("$version");
+
} catch(err) {
-
+ try {
+ fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+ ver = fo && fo.GetVariable("$version");
+ } catch(err2) { }
}
}
View
BIN test/toolbox/clock.swf
Binary file not shown.
View
23 test/toolbox/flashembed.htm
@@ -0,0 +1,23 @@
+
+<script src="../js/jquery-1.4.2.js"></script>
+<script src="../../src/toolbox/toolbox.flashembed.js"></script>
+
+<style>
+#clock {
+ width: 250px;
+ height: 250px;
+}
+</style>
+
+</head>
+
+<body>
+
+<div id="clock"></div>
+
+<script>
+flashembed("clock", "clock.swf");
+</script>
+
+
+

0 comments on commit a128c0e

Please sign in to comment.