Cross Reference: /yui3/src/swf/tests/basic.html
basic.html revision b5ea9923e255f649110ea11465ba8db74a5eb395
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<title>SWF Tests</title>
<link type="text/css" rel="stylesheet" href="/build/logreader/assets/skins/sam/logreader.css" />
<script type="text/javascript" src="/build/yui/yui.js"></script>
</head>
<body>
<h1>SWF Tests</h1>
<div id="testdiv" style="height:400px;width:550px">
This content will be replaced by an instance of a Flash player.
</div>
<script>
YUI({
base: '/build/',
filter: "raw",
modules: {
swfdetect: {
path: "swfdetect/swfdetect.js"
},
swf: {
path: "swf/swf.js"
}
}
}).use('node', 'event-custom', 'swfdetect', 'swf', function (Y) {
var params = {version: "9.0.115",
useExpressInstall: false,
fixedAttributes:
{allowScriptAccess:"always", allowNetworking:"all", width:50},
flashVars:
{flashvar1: "One word", flashvar2: "A word & another", flashvar3: "Three words - 100% done & done"}
};
var newswf = new Y.SWF("#testdiv", "assets/Simple.swf?x=" + Math.floor(Math.random()*100000), params);
newswf.on("swfReady", talkToFlash);
function talkToFlash (e) {
newswf.callSWF("addText", ["\nExternalInterface bridge is working.\n"]);
newswf.createInstance("mystr", "String", ["Hello world"]);
newswf.exposeMethod("mystr", "charAt", "mystr_charAt");
alert(newswf.callSWF("mystr_charAt", [3]));
}
});
</script>
</body>
</html>