1 | <html> |
---|
2 | <head> |
---|
3 | <title>dojox.embed.Flash Detection Test</title> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
5 | <style type="text/css"> |
---|
6 | @import "../../../dojo/resources/dojo.css"; |
---|
7 | @import "../../../dijit/tests/css/dijitTests.css"; |
---|
8 | </style> |
---|
9 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async:1, isDebug: true, fontSizeWatch: true" ></script> |
---|
10 | <script type="text/javascript"> |
---|
11 | require(["dojo", "dojox/embed/Flash", "dojo/domReady!"], function(dojo){ |
---|
12 | onDomReady(); |
---|
13 | }); |
---|
14 | |
---|
15 | |
---|
16 | /******************************************************************* |
---|
17 | A note. |
---|
18 | |
---|
19 | You *can* dojo.require dojox.embed.Flash on the fly (i.e. |
---|
20 | after load), but if you do so, you *must* give Safari and IE |
---|
21 | a little bit of time before you can start using any of the |
---|
22 | methods. Quick tests showed that 200ms is more than enough, |
---|
23 | but you should test intervals at your discretion. |
---|
24 | ********************************************************************/ |
---|
25 | |
---|
26 | |
---|
27 | function log(msg){ |
---|
28 | dojo.byId("fakeconsole").innerHTML += "<div>"+msg+"</div>"; |
---|
29 | } |
---|
30 | |
---|
31 | onDomReady = function(){ |
---|
32 | var testMovieUrl=dojo.moduleUrl("dojox", "embed/tests/resources/hfp.swf"), movie; |
---|
33 | var proxyMovieUrl=dojo.moduleUrl("dojox", "embed/tests/resources/TestFlash.swf"), proxy; |
---|
34 | |
---|
35 | dojo.byId("results").innerHTML = dojo.toJson(dojox.embed.Flash.version); |
---|
36 | movie=new dojox.embed.Flash({ path: testMovieUrl }, "flashHolder"); |
---|
37 | dojo.connect(movie, "onReady", function(mv){ |
---|
38 | console.log("The test movie loaded."); |
---|
39 | }); |
---|
40 | |
---|
41 | proxy = new dojox.embed.Flash({ path: proxyMovieUrl, width:4, height:4 }, "proxyHolder"); |
---|
42 | dojo.connect(proxy, "onLoad", function(m){ |
---|
43 | dojox.embed.Flash.proxy(proxy, [ "setMessage", "getMessage" ]); |
---|
44 | console.log("Setting the message on the proxy to 'we love dojox.embed!'"); |
---|
45 | proxy.setMessage("we love dojox.embed"); |
---|
46 | console.log("The message stored in the test movie is: '", proxy.getMessage(), "'"); |
---|
47 | }); |
---|
48 | }; |
---|
49 | </script> |
---|
50 | </head> |
---|
51 | <body> |
---|
52 | <h1>Dojo.embed.Flash detection tests.</h1> |
---|
53 | <p> |
---|
54 | This page is testing the base Flash movie generator. |
---|
55 | </p> |
---|
56 | <div id="fakeconsole"></div> |
---|
57 | <p>Installed Flash version: <span id="results"></span>.</p> |
---|
58 | <div id="flashHolder" style="border:1px solid black;"> |
---|
59 | A movie will be inserted here on load. |
---|
60 | </div> |
---|
61 | <div id="proxyHolder" style="width:4px;height:4px;position:absolute;"></div> |
---|
62 | </body> |
---|
63 | </html> |
---|