noah 0.0.5 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +9 -0
  3. data/LICENSE +201 -0
  4. data/README.md +68 -212
  5. data/Rakefile +70 -41
  6. data/TODO.md +59 -0
  7. data/bin/noah +2 -1
  8. data/bin/noah-watcher.rb +93 -0
  9. data/config.ru +6 -3
  10. data/config/warble.rb +18 -0
  11. data/examples/README.md +116 -0
  12. data/examples/cluster.ru +2 -0
  13. data/examples/custom-watcher.rb +10 -0
  14. data/examples/httpclient-server.rb +7 -0
  15. data/examples/httpclient.rb +12 -0
  16. data/examples/httpclient2.rb +28 -0
  17. data/examples/js/FABridge.js +1452 -0
  18. data/examples/js/WebSocketMain.swf +830 -0
  19. data/examples/js/swfobject.js +851 -0
  20. data/examples/js/web_socket.js +312 -0
  21. data/examples/logger.rb +11 -0
  22. data/examples/reconfiguring-sinatra-watcher.rb +11 -0
  23. data/examples/reconfiguring-sinatra.rb +32 -0
  24. data/examples/simple-post.rb +17 -0
  25. data/examples/websocket.html +24 -0
  26. data/examples/websocket.rb +41 -0
  27. data/lib/noah.rb +5 -8
  28. data/lib/noah/app.rb +20 -268
  29. data/lib/noah/application_routes.rb +70 -0
  30. data/lib/noah/ark.rb +0 -0
  31. data/lib/noah/configuration_routes.rb +81 -0
  32. data/lib/noah/ephemeral_routes.rb +19 -0
  33. data/lib/noah/helpers.rb +12 -14
  34. data/lib/noah/host_routes.rb +69 -0
  35. data/lib/noah/models.rb +86 -5
  36. data/lib/noah/models/applications.rb +41 -0
  37. data/lib/noah/models/configurations.rb +49 -0
  38. data/lib/noah/models/ephemerals.rb +33 -0
  39. data/lib/noah/models/hosts.rb +56 -0
  40. data/lib/noah/models/services.rb +54 -0
  41. data/lib/noah/models/watchers.rb +54 -0
  42. data/lib/noah/passthrough.rb +11 -0
  43. data/lib/noah/service_routes.rb +71 -0
  44. data/lib/noah/validations.rb +1 -0
  45. data/lib/noah/validations/watcher_validations.rb +48 -0
  46. data/lib/noah/version.rb +1 -1
  47. data/lib/noah/watcher.rb +75 -0
  48. data/lib/noah/watcher_routes.rb +12 -0
  49. data/lib/vendor/em-hiredis/Gemfile +4 -0
  50. data/lib/vendor/em-hiredis/README.md +61 -0
  51. data/lib/vendor/em-hiredis/Rakefile +2 -0
  52. data/lib/vendor/em-hiredis/em-hiredis-0.0.1.gem +0 -0
  53. data/lib/vendor/em-hiredis/em-hiredis.gemspec +23 -0
  54. data/lib/vendor/em-hiredis/lib/em-hiredis.rb +22 -0
  55. data/lib/vendor/em-hiredis/lib/em-hiredis/client.rb +131 -0
  56. data/lib/vendor/em-hiredis/lib/em-hiredis/connection.rb +61 -0
  57. data/lib/vendor/em-hiredis/lib/em-hiredis/event_emitter.rb +29 -0
  58. data/lib/vendor/em-hiredis/lib/em-hiredis/version.rb +5 -0
  59. data/noah.gemspec +21 -17
  60. data/spec/application_spec.rb +30 -30
  61. data/spec/configuration_spec.rb +81 -14
  62. data/spec/ephemeral_spec.rb +52 -0
  63. data/spec/host_spec.rb +21 -21
  64. data/spec/noahapp_application_spec.rb +6 -6
  65. data/spec/noahapp_configuration_spec.rb +3 -3
  66. data/spec/noahapp_host_spec.rb +2 -2
  67. data/spec/noahapp_service_spec.rb +9 -9
  68. data/spec/noahapp_watcher_spec.rb +34 -0
  69. data/spec/service_spec.rb +27 -27
  70. data/spec/spec_helper.rb +13 -22
  71. data/spec/support/db/.keep +0 -0
  72. data/spec/support/test-redis.conf +8 -0
  73. data/spec/watcher_spec.rb +62 -0
  74. data/views/index.haml +21 -15
  75. metadata +124 -148
  76. data/Gemfile.lock +0 -85
  77. data/doc/coverage/index.html +0 -138
  78. data/doc/coverage/jquery-1.3.2.min.js +0 -19
  79. data/doc/coverage/jquery.tablesorter.min.js +0 -15
  80. data/doc/coverage/lib-helpers_rb.html +0 -393
  81. data/doc/coverage/lib-models_rb.html +0 -1449
  82. data/doc/coverage/noah_rb.html +0 -2019
  83. data/doc/coverage/print.css +0 -12
  84. data/doc/coverage/rcov.js +0 -42
  85. data/doc/coverage/screen.css +0 -270
  86. data/lib/noah/applications.rb +0 -46
  87. data/lib/noah/configurations.rb +0 -49
  88. data/lib/noah/hosts.rb +0 -54
  89. data/lib/noah/services.rb +0 -57
  90. data/lib/noah/watchers.rb +0 -18
@@ -0,0 +1,2 @@
1
+ require './simple-post.rb'
2
+ run NoahPostDemo
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '..','lib','noah','watcher')
4
+
5
+ class StdoutWatcher < Noah::Watcher
6
+ redis_host "redis://127.0.0.1:6379/0"
7
+ pattern "//noah/configuration/redis_server"
8
+ destination Proc.new {|x| puts x}
9
+ run!
10
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require 'sinatra'
3
+ require 'json'
4
+ post '/webhook' do
5
+ x = request.body.read
6
+ puts JSON.load(x)
7
+ end
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '..','lib','noah','watcher')
4
+ require 'excon'
5
+
6
+
7
+ class HttpPostWatch < Noah::Watcher
8
+ redis_host "redis://127.0.0.1:6379/0"
9
+ pattern "//noah/configuration"
10
+ destination Proc.new {|x| ::Excon.post("http://localhost:4567/webhook", :headers => {"Content-Type" => "application/json"}, :body => x)}
11
+ run!
12
+ end
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pp'
4
+ require File.join(File.dirname(__FILE__), '..','lib','noah.rb')
5
+
6
+ # This doesn't actually send watch notifications
7
+ # but it shows how you could register a new watch
8
+ # for the agents to handle
9
+ a = Noah::Application.new
10
+ a.name = "my_kickass_application"
11
+ a.valid?
12
+ a.save
13
+
14
+ a.watch! :endpoint => 'http://localhost:4567/webhook' # Boom headshot
15
+ pp Noah::Watcher.find(:pattern => "//noah/application/my_kickass_application").first
16
+ # Default watch pattern is '//noah/model/name'
17
+
18
+ # You can also register a new watch with a custom pattern - kind of pointless obviously
19
+ b = Noah::Configuration.new
20
+ b.name = "my_awesome_configuration"
21
+ b.valid?
22
+ b.save
23
+ b.watch! :endpoint => 'http://localhost:4567/webhook', :pattern => '//noah/configuration/my_awesome_configuration'
24
+ pp Noah::Watcher.find(:pattern => "//noah/configuration/my_awesome_configuration").first
25
+ # There's now a watcher for pattern 'noah.application.my_other_awesome_app.delete'
26
+
27
+ # The idea now is that some background watcher agent will pick up on these registered watches
28
+ # See https://github.com/lusis/Noah/wiki/Watcher-Braindump
@@ -0,0 +1,1452 @@
1
+
2
+
3
+
4
+
5
+
6
+ <!DOCTYPE html>
7
+ <html>
8
+ <head>
9
+ <meta charset='utf-8'>
10
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
11
+ <title>examples/js/FABridge.js at master from igrigorik's em-websocket - GitHub</title>
12
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
13
+ <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
14
+
15
+ <link href="https://assets2.github.com/stylesheets/bundle_common.css?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" media="screen" rel="stylesheet" type="text/css" />
16
+ <link href="https://assets1.github.com/stylesheets/bundle_github.css?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" media="screen" rel="stylesheet" type="text/css" />
17
+
18
+ <script type="text/javascript">
19
+ if (typeof console == "undefined" || typeof console.log == "undefined")
20
+ console = { log: function() {} }
21
+ </script>
22
+ <script type="text/javascript" charset="utf-8">
23
+ var GitHub = {}
24
+ var github_user = null
25
+
26
+ </script>
27
+ <script src="https://assets3.github.com/javascripts/jquery/jquery-1.4.2.min.js?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" type="text/javascript"></script>
28
+ <script src="https://assets0.github.com/javascripts/bundle_common.js?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" type="text/javascript"></script>
29
+ <script src="https://assets0.github.com/javascripts/bundle_github.js?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" type="text/javascript"></script>
30
+
31
+
32
+ <script type="text/javascript" charset="utf-8">
33
+ GitHub.spy({
34
+ repo: "igrigorik/em-websocket"
35
+ })
36
+ </script>
37
+
38
+
39
+
40
+
41
+
42
+
43
+ <link href="https://github.com/igrigorik/em-websocket/commits/master.atom" rel="alternate" title="Recent Commits to em-websocket:master" type="application/atom+xml" />
44
+
45
+ <meta name="description" content="EventMachine based WebSocket server" />
46
+ <script type="text/javascript">
47
+ GitHub.nameWithOwner = GitHub.nameWithOwner || "igrigorik/em-websocket";
48
+ GitHub.currentRef = 'master';
49
+ GitHub.commitSHA = "cdedd7bd5c43e25fd0b30236889bc131b5cbe495";
50
+ GitHub.currentPath = 'examples/js/FABridge.js';
51
+ GitHub.masterBranch = "master";
52
+
53
+
54
+ </script>
55
+
56
+
57
+ <script type="text/javascript">
58
+ var _gaq = _gaq || [];
59
+ _gaq.push(['_setAccount', 'UA-3769691-2']);
60
+ _gaq.push(['_trackPageview']);
61
+ (function() {
62
+ var ga = document.createElement('script');
63
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
64
+ ga.setAttribute('async', 'true');
65
+ document.documentElement.firstChild.appendChild(ga);
66
+ })();
67
+ </script>
68
+
69
+ <script type="text/javascript">
70
+ var mpq = [];
71
+ mpq.push(["init", "65fde2abd433eae3b32b38b7ebd2f37e"]);
72
+ (function() {
73
+ var mp = document.createElement("script"); mp.type = "text/javascript"; mp.async = true;
74
+ mp.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + "//api.mixpanel.com/site_media/js/api/mixpanel.js";
75
+ var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(mp, s);
76
+ })();
77
+ </script>
78
+
79
+ </head>
80
+
81
+
82
+
83
+ <body class="logged_out page-blob">
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+ <div class="subnavd" id="main">
95
+ <div id="header" class="true">
96
+
97
+ <a class="logo boring" href="https://github.com">
98
+ <img src="/images/modules/header/logov3.png?changed" class="default" alt="github" />
99
+ <![if !IE]>
100
+ <img src="/images/modules/header/logov3-hover.png" class="hover" alt="github" />
101
+ <![endif]>
102
+ </a>
103
+
104
+
105
+ <div class="topsearch">
106
+
107
+ <ul class="nav logged_out">
108
+ <li class="pricing"><a href="/plans">Pricing and Signup</a></li>
109
+ <li class="explore"><a href="/explore">Explore GitHub</a></li>
110
+ <li class="features"><a href="/features">Features</a></li>
111
+ <li class="blog"><a href="/blog">Blog</a></li>
112
+ <li class="login"><a href="/login?return_to=https://github.com/igrigorik/em-websocket/blob/master/examples/js/FABridge.js">Login</a></li>
113
+ </ul>
114
+
115
+ </div>
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+ <div class="site">
123
+ <div class="pagehead repohead vis-public ">
124
+
125
+
126
+
127
+ <div class="title-actions-bar">
128
+ <h1>
129
+ <a href="/igrigorik">igrigorik</a> / <strong><a href="https://github.com/igrigorik/em-websocket">em-websocket</a></strong>
130
+
131
+
132
+ </h1>
133
+
134
+
135
+ <ul class="actions">
136
+
137
+
138
+
139
+ <li class="for-owner" style="display:none"><a href="https://github.com/igrigorik/em-websocket/admin" class="minibutton btn-admin "><span><span class="icon"></span>Admin</span></a></li>
140
+ <li>
141
+ <a href="/igrigorik/em-websocket/toggle_watch" class="minibutton btn-watch " id="watch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'a704e3e9a52a8249af74f3ff2cb305c3d839fd8e'); f.appendChild(s);f.submit();return false;" style="display:none"><span><span class="icon"></span>Watch</span></a>
142
+ <a href="/igrigorik/em-websocket/toggle_watch" class="minibutton btn-watch " id="unwatch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'a704e3e9a52a8249af74f3ff2cb305c3d839fd8e'); f.appendChild(s);f.submit();return false;" style="display:none"><span><span class="icon"></span>Unwatch</span></a>
143
+ </li>
144
+
145
+
146
+ <li class="for-notforked" style="display:none"><a href="/igrigorik/em-websocket/fork" class="minibutton btn-fork " id="fork_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'a704e3e9a52a8249af74f3ff2cb305c3d839fd8e'); f.appendChild(s);f.submit();return false;"><span><span class="icon"></span>Fork</span></a></li>
147
+ <li class="for-hasfork" style="display:none"><a href="#" class="minibutton btn-fork " id="your_fork_button"><span><span class="icon"></span>Your Fork</span></a></li>
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <li class="repostats">
155
+ <ul class="repo-stats">
156
+ <li class="watchers"><a href="/igrigorik/em-websocket/watchers" title="Watchers" class="tooltipped downwards">365</a></li>
157
+ <li class="forks"><a href="/igrigorik/em-websocket/network" title="Forks" class="tooltipped downwards">20</a></li>
158
+ </ul>
159
+ </li>
160
+ </ul>
161
+
162
+ </div>
163
+
164
+
165
+ <ul class="tabs">
166
+ <li><a href="https://github.com/igrigorik/em-websocket" class="selected" highlight="repo_source">Source</a></li>
167
+ <li><a href="https://github.com/igrigorik/em-websocket/commits/master" highlight="repo_commits">Commits</a></li>
168
+ <li><a href="/igrigorik/em-websocket/network" highlight="repo_network">Network</a></li>
169
+ <li><a href="/igrigorik/em-websocket/pulls" highlight="repo_pulls">Pull Requests (1)</a></li>
170
+
171
+
172
+
173
+
174
+
175
+ <li><a href="/igrigorik/em-websocket/issues" highlight="issues">Issues (7)</a></li>
176
+
177
+
178
+ <li><a href="/igrigorik/em-websocket/wiki" highlight="repo_wiki">Wiki (1)</a></li>
179
+
180
+ <li><a href="/igrigorik/em-websocket/graphs" highlight="repo_graphs">Graphs</a></li>
181
+
182
+ <li class="contextswitch nochoices">
183
+ <span class="toggle leftwards" >
184
+ <em>Branch:</em>
185
+ <code>master</code>
186
+ </span>
187
+ </li>
188
+ </ul>
189
+
190
+ <div style="display:none" id="pl-description"><p><em class="placeholder">click here to add a description</em></p></div>
191
+ <div style="display:none" id="pl-homepage"><p><em class="placeholder">click here to add a homepage</em></p></div>
192
+
193
+ <div class="subnav-bar">
194
+
195
+ <ul>
196
+ <li>
197
+ <a href="#" class="dropdown">Switch Branches (4)</a>
198
+ <ul>
199
+
200
+
201
+
202
+ <li><a href="/igrigorik/em-websocket/blob/draft03/examples/js/FABridge.js" action="show">draft03</a></li>
203
+
204
+
205
+
206
+ <li><strong>master &#x2713;</strong></li>
207
+
208
+
209
+
210
+ <li><a href="/igrigorik/em-websocket/blob/onerror/examples/js/FABridge.js" action="show">onerror</a></li>
211
+
212
+
213
+
214
+
215
+ <li><a href="/igrigorik/em-websocket/blob/ruby19fixes/examples/js/FABridge.js" action="show">ruby19fixes</a></li>
216
+
217
+
218
+ </ul>
219
+ </li>
220
+ <li>
221
+ <a href="#" class="dropdown ">Switch Tags (2)</a>
222
+ <ul>
223
+
224
+ <li><a href="/igrigorik/em-websocket/blob/v0.2.0/examples/js/FABridge.js">v0.2.0</a></li>
225
+
226
+
227
+ <li><a href="/igrigorik/em-websocket/blob/v0.1.4/examples/js/FABridge.js">v0.1.4</a></li>
228
+
229
+ </ul>
230
+
231
+ </li>
232
+ <li>
233
+
234
+ <a href="/igrigorik/em-websocket/branches" class="manage">Branch List</a>
235
+
236
+ </li>
237
+ </ul>
238
+ </div>
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <div class="frame frame-center tree-finder" style="display: none">
251
+ <div class="breadcrumb">
252
+ <b><a href="/igrigorik/em-websocket">em-websocket</a></b> /
253
+ <input class="tree-finder-input" type="text" name="query" autocomplete="off" spellcheck="false">
254
+ </div>
255
+
256
+
257
+ <div class="octotip">
258
+ <p>
259
+ <a href="/igrigorik/em-websocket/dismiss-tree-finder-help" class="dismiss js-dismiss-tree-list-help" title="Hide this notice forever">Dismiss</a>
260
+ <strong>Octotip:</strong> You've activated the <em>file finder</em> by pressing <span class="kbd">t</span>
261
+ Start typing to filter the file list. Use <span class="kbd badmono">↑</span> and <span class="kbd badmono">↓</span> to navigate,
262
+ <span class="kbd">enter</span> to view files.
263
+ </p>
264
+ </div>
265
+
266
+
267
+ <table class="tree-browser" cellpadding="0" cellspacing="0">
268
+ <tr class="js-header"><th>&nbsp;</th><th>name</th></tr>
269
+ <tr class="js-no-results no-results" style="display: none">
270
+ <th colspan="2">No matching files</th>
271
+ </tr>
272
+ <tbody class="js-results-list">
273
+ </tbody>
274
+ </table>
275
+ </div>
276
+
277
+ <div id="repo_details" class="metabox clearfix">
278
+ <div id="repo_details_loader" class="metabox-loader" style="display:none">Sending Request&hellip;</div>
279
+
280
+ <a href="/igrigorik/em-websocket/downloads" class="download-source" id="download_button" title="Download source, tagged packages and binaries."><span class="icon"></span>Downloads</a>
281
+
282
+ <div id="repository_desc_wrapper">
283
+ <div id="repository_description" rel="repository_description_edit">
284
+
285
+ <p>EventMachine based WebSocket server
286
+ <span id="read_more" style="display:none">&mdash; <a href="#readme">Read more</a></span>
287
+ </p>
288
+
289
+ </div>
290
+
291
+ <div id="repository_description_edit" style="display:none;" class="inline-edit">
292
+ <form action="/igrigorik/em-websocket/admin/update" method="post"><div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="a704e3e9a52a8249af74f3ff2cb305c3d839fd8e" /></div>
293
+ <input type="hidden" name="field" value="repository_description">
294
+ <input type="text" class="textfield" name="value" value="EventMachine based WebSocket server">
295
+ <div class="form-actions">
296
+ <button class="minibutton"><span>Save</span></button> &nbsp; <a href="#" class="cancel">Cancel</a>
297
+ </div>
298
+ </form>
299
+ </div>
300
+
301
+
302
+ <div class="repository-homepage" id="repository_homepage" rel="repository_homepage_edit">
303
+ <p><a href="http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/" rel="nofollow">http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/</a></p>
304
+ </div>
305
+
306
+ <div id="repository_homepage_edit" style="display:none;" class="inline-edit">
307
+ <form action="/igrigorik/em-websocket/admin/update" method="post"><div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="a704e3e9a52a8249af74f3ff2cb305c3d839fd8e" /></div>
308
+ <input type="hidden" name="field" value="repository_homepage">
309
+ <input type="text" class="textfield" name="value" value="http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/">
310
+ <div class="form-actions">
311
+ <button class="minibutton"><span>Save</span></button> &nbsp; <a href="#" class="cancel">Cancel</a>
312
+ </div>
313
+ </form>
314
+ </div>
315
+ </div>
316
+ <div class="rule "></div>
317
+ <div id="url_box" class="url-box">
318
+ <ul class="clone-urls">
319
+
320
+
321
+ <li id="http_clone_url"><a href="https://github.com/igrigorik/em-websocket.git" data-permissions="Read-Only">HTTP</a></li>
322
+ <li id="public_clone_url"><a href="git://github.com/igrigorik/em-websocket.git" data-permissions="Read-Only">Git Read-Only</a></li>
323
+
324
+
325
+ </ul>
326
+ <input type="text" spellcheck="false" id="url_field" class="url-field" />
327
+ <span style="display:none" id="url_box_clippy"></span>
328
+ <span id="clippy_tooltip_url_box_clippy" class="clippy-tooltip tooltipped" title="copy to clipboard">
329
+ <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
330
+ width="14"
331
+ height="14"
332
+ class="clippy"
333
+ id="clippy" >
334
+ <param name="movie" value="https://assets3.github.com/flash/clippy.swf?v5"/>
335
+ <param name="allowScriptAccess" value="always" />
336
+ <param name="quality" value="high" />
337
+ <param name="scale" value="noscale" />
338
+ <param NAME="FlashVars" value="id=url_box_clippy&amp;copied=&amp;copyto=">
339
+ <param name="bgcolor" value="#FFFFFF">
340
+ <param name="wmode" value="opaque">
341
+ <embed src="https://assets3.github.com/flash/clippy.swf?v5"
342
+ width="14"
343
+ height="14"
344
+ name="clippy"
345
+ quality="high"
346
+ allowScriptAccess="always"
347
+ type="application/x-shockwave-flash"
348
+ pluginspage="http://www.macromedia.com/go/getflashplayer"
349
+ FlashVars="id=url_box_clippy&amp;copied=&amp;copyto="
350
+ bgcolor="#FFFFFF"
351
+ wmode="opaque"
352
+ />
353
+ </object>
354
+ </span>
355
+
356
+ <p id="url_description">This URL has <strong>Read+Write</strong> access</p>
357
+ </div>
358
+ </div>
359
+
360
+
361
+
362
+
363
+ </div><!-- /.pagehead -->
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <script type="text/javascript">
372
+ GitHub.downloadRepo = '/igrigorik/em-websocket/archives/master'
373
+ GitHub.revType = "master"
374
+
375
+ GitHub.controllerName = "blob"
376
+ GitHub.actionName = "show"
377
+ GitHub.currentAction = "blob#show"
378
+
379
+
380
+
381
+
382
+ </script>
383
+
384
+
385
+
386
+
387
+
388
+
389
+ <div class="flash-messages"></div>
390
+
391
+
392
+ <div id="commit">
393
+ <div class="group">
394
+
395
+ <div class="envelope commit">
396
+ <div class="human">
397
+
398
+ <div class="message"><pre><a href="/igrigorik/em-websocket/commit/cdedd7bd5c43e25fd0b30236889bc131b5cbe495">Added Gemfile.lock to gitignore</a> </pre></div>
399
+
400
+
401
+ <div class="actor">
402
+ <div class="gravatar">
403
+
404
+ <img src="https://secure.gravatar.com/avatar/b96c2426a6ef84c069876e80e49a600b?s=140&d=https://github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" alt="" width="30" height="30" />
405
+ </div>
406
+ <div class="name"><a href="/mloughran">mloughran</a> <span>(author)</span></div>
407
+ <div class="date">
408
+ <abbr class="relatize" title="2011-02-07 04:29:18">Mon Feb 07 04:29:18 -0800 2011</abbr>
409
+ </div>
410
+ </div>
411
+
412
+
413
+
414
+ </div>
415
+ <div class="machine">
416
+ <span>c</span>ommit&nbsp;&nbsp;<a href="/igrigorik/em-websocket/commit/cdedd7bd5c43e25fd0b30236889bc131b5cbe495" hotkey="c">cdedd7bd5c43e25fd0b3</a><br />
417
+ <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="/igrigorik/em-websocket/tree/cdedd7bd5c43e25fd0b30236889bc131b5cbe495" hotkey="t">087af53398020bbc09b5</a><br />
418
+
419
+ <span>p</span>arent&nbsp;
420
+
421
+ <a href="/igrigorik/em-websocket/tree/97c850128ccd49063d12dde2512cbdd1d3c128a2" hotkey="p">97c850128ccd49063d12</a>
422
+
423
+
424
+ </div>
425
+ </div>
426
+
427
+ </div>
428
+ </div>
429
+
430
+
431
+
432
+ <div id="slider">
433
+
434
+
435
+
436
+ <div class="breadcrumb" data-path="examples/js/FABridge.js/">
437
+ <b><a href="/igrigorik/em-websocket/tree/cdedd7bd5c43e25fd0b30236889bc131b5cbe495">em-websocket</a></b> / <a href="/igrigorik/em-websocket/tree/cdedd7bd5c43e25fd0b30236889bc131b5cbe495/examples">examples</a> / <a href="/igrigorik/em-websocket/tree/cdedd7bd5c43e25fd0b30236889bc131b5cbe495/examples/js">js</a> / FABridge.js <span style="display:none" id="clippy_355">examples/js/FABridge.js</span>
438
+
439
+ <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
440
+ width="110"
441
+ height="14"
442
+ class="clippy"
443
+ id="clippy" >
444
+ <param name="movie" value="https://assets0.github.com/flash/clippy.swf?v5"/>
445
+ <param name="allowScriptAccess" value="always" />
446
+ <param name="quality" value="high" />
447
+ <param name="scale" value="noscale" />
448
+ <param NAME="FlashVars" value="id=clippy_355&amp;copied=copied!&amp;copyto=copy to clipboard">
449
+ <param name="bgcolor" value="#FFFFFF">
450
+ <param name="wmode" value="opaque">
451
+ <embed src="https://assets0.github.com/flash/clippy.swf?v5"
452
+ width="110"
453
+ height="14"
454
+ name="clippy"
455
+ quality="high"
456
+ allowScriptAccess="always"
457
+ type="application/x-shockwave-flash"
458
+ pluginspage="http://www.macromedia.com/go/getflashplayer"
459
+ FlashVars="id=clippy_355&amp;copied=copied!&amp;copyto=copy to clipboard"
460
+ bgcolor="#FFFFFF"
461
+ wmode="opaque"
462
+ />
463
+ </object>
464
+
465
+
466
+ </div>
467
+
468
+ <div class="frames">
469
+ <div class="frame frame-center" data-path="examples/js/FABridge.js/">
470
+
471
+ <ul class="big-actions">
472
+
473
+ <li><a class="file-edit-link minibutton" href="/igrigorik/em-websocket/file-edit/__current_ref__/examples/js/FABridge.js"><span>Edit this file</span></a></li>
474
+ </ul>
475
+
476
+
477
+ <div id="files">
478
+ <div class="file">
479
+ <div class="meta">
480
+ <div class="info">
481
+ <span class="icon"><img alt="Txt" height="16" src="https://assets1.github.com/images/icons/txt.png?8ba4a5b555baa7617baab8277634c5c7550a44d7" width="16" /></span>
482
+ <span class="mode" title="File Mode">100644</span>
483
+
484
+ <span>605 lines (535 sloc)</span>
485
+
486
+ <span>18.306 kb</span>
487
+ </div>
488
+ <ul class="actions">
489
+ <li><a href="/igrigorik/em-websocket/raw/master/examples/js/FABridge.js" id="raw-url">raw</a></li>
490
+
491
+ <li><a href="/igrigorik/em-websocket/blame/master/examples/js/FABridge.js">blame</a></li>
492
+
493
+ <li><a href="/igrigorik/em-websocket/commits/master/examples/js/FABridge.js">history</a></li>
494
+ </ul>
495
+ </div>
496
+
497
+ <div class="data type-javascript">
498
+
499
+ <table cellpadding="0" cellspacing="0">
500
+ <tr>
501
+ <td>
502
+ <pre class="line_numbers"><span id="L1" rel="#L1">1</span>
503
+ <span id="L2" rel="#L2">2</span>
504
+ <span id="L3" rel="#L3">3</span>
505
+ <span id="L4" rel="#L4">4</span>
506
+ <span id="L5" rel="#L5">5</span>
507
+ <span id="L6" rel="#L6">6</span>
508
+ <span id="L7" rel="#L7">7</span>
509
+ <span id="L8" rel="#L8">8</span>
510
+ <span id="L9" rel="#L9">9</span>
511
+ <span id="L10" rel="#L10">10</span>
512
+ <span id="L11" rel="#L11">11</span>
513
+ <span id="L12" rel="#L12">12</span>
514
+ <span id="L13" rel="#L13">13</span>
515
+ <span id="L14" rel="#L14">14</span>
516
+ <span id="L15" rel="#L15">15</span>
517
+ <span id="L16" rel="#L16">16</span>
518
+ <span id="L17" rel="#L17">17</span>
519
+ <span id="L18" rel="#L18">18</span>
520
+ <span id="L19" rel="#L19">19</span>
521
+ <span id="L20" rel="#L20">20</span>
522
+ <span id="L21" rel="#L21">21</span>
523
+ <span id="L22" rel="#L22">22</span>
524
+ <span id="L23" rel="#L23">23</span>
525
+ <span id="L24" rel="#L24">24</span>
526
+ <span id="L25" rel="#L25">25</span>
527
+ <span id="L26" rel="#L26">26</span>
528
+ <span id="L27" rel="#L27">27</span>
529
+ <span id="L28" rel="#L28">28</span>
530
+ <span id="L29" rel="#L29">29</span>
531
+ <span id="L30" rel="#L30">30</span>
532
+ <span id="L31" rel="#L31">31</span>
533
+ <span id="L32" rel="#L32">32</span>
534
+ <span id="L33" rel="#L33">33</span>
535
+ <span id="L34" rel="#L34">34</span>
536
+ <span id="L35" rel="#L35">35</span>
537
+ <span id="L36" rel="#L36">36</span>
538
+ <span id="L37" rel="#L37">37</span>
539
+ <span id="L38" rel="#L38">38</span>
540
+ <span id="L39" rel="#L39">39</span>
541
+ <span id="L40" rel="#L40">40</span>
542
+ <span id="L41" rel="#L41">41</span>
543
+ <span id="L42" rel="#L42">42</span>
544
+ <span id="L43" rel="#L43">43</span>
545
+ <span id="L44" rel="#L44">44</span>
546
+ <span id="L45" rel="#L45">45</span>
547
+ <span id="L46" rel="#L46">46</span>
548
+ <span id="L47" rel="#L47">47</span>
549
+ <span id="L48" rel="#L48">48</span>
550
+ <span id="L49" rel="#L49">49</span>
551
+ <span id="L50" rel="#L50">50</span>
552
+ <span id="L51" rel="#L51">51</span>
553
+ <span id="L52" rel="#L52">52</span>
554
+ <span id="L53" rel="#L53">53</span>
555
+ <span id="L54" rel="#L54">54</span>
556
+ <span id="L55" rel="#L55">55</span>
557
+ <span id="L56" rel="#L56">56</span>
558
+ <span id="L57" rel="#L57">57</span>
559
+ <span id="L58" rel="#L58">58</span>
560
+ <span id="L59" rel="#L59">59</span>
561
+ <span id="L60" rel="#L60">60</span>
562
+ <span id="L61" rel="#L61">61</span>
563
+ <span id="L62" rel="#L62">62</span>
564
+ <span id="L63" rel="#L63">63</span>
565
+ <span id="L64" rel="#L64">64</span>
566
+ <span id="L65" rel="#L65">65</span>
567
+ <span id="L66" rel="#L66">66</span>
568
+ <span id="L67" rel="#L67">67</span>
569
+ <span id="L68" rel="#L68">68</span>
570
+ <span id="L69" rel="#L69">69</span>
571
+ <span id="L70" rel="#L70">70</span>
572
+ <span id="L71" rel="#L71">71</span>
573
+ <span id="L72" rel="#L72">72</span>
574
+ <span id="L73" rel="#L73">73</span>
575
+ <span id="L74" rel="#L74">74</span>
576
+ <span id="L75" rel="#L75">75</span>
577
+ <span id="L76" rel="#L76">76</span>
578
+ <span id="L77" rel="#L77">77</span>
579
+ <span id="L78" rel="#L78">78</span>
580
+ <span id="L79" rel="#L79">79</span>
581
+ <span id="L80" rel="#L80">80</span>
582
+ <span id="L81" rel="#L81">81</span>
583
+ <span id="L82" rel="#L82">82</span>
584
+ <span id="L83" rel="#L83">83</span>
585
+ <span id="L84" rel="#L84">84</span>
586
+ <span id="L85" rel="#L85">85</span>
587
+ <span id="L86" rel="#L86">86</span>
588
+ <span id="L87" rel="#L87">87</span>
589
+ <span id="L88" rel="#L88">88</span>
590
+ <span id="L89" rel="#L89">89</span>
591
+ <span id="L90" rel="#L90">90</span>
592
+ <span id="L91" rel="#L91">91</span>
593
+ <span id="L92" rel="#L92">92</span>
594
+ <span id="L93" rel="#L93">93</span>
595
+ <span id="L94" rel="#L94">94</span>
596
+ <span id="L95" rel="#L95">95</span>
597
+ <span id="L96" rel="#L96">96</span>
598
+ <span id="L97" rel="#L97">97</span>
599
+ <span id="L98" rel="#L98">98</span>
600
+ <span id="L99" rel="#L99">99</span>
601
+ <span id="L100" rel="#L100">100</span>
602
+ <span id="L101" rel="#L101">101</span>
603
+ <span id="L102" rel="#L102">102</span>
604
+ <span id="L103" rel="#L103">103</span>
605
+ <span id="L104" rel="#L104">104</span>
606
+ <span id="L105" rel="#L105">105</span>
607
+ <span id="L106" rel="#L106">106</span>
608
+ <span id="L107" rel="#L107">107</span>
609
+ <span id="L108" rel="#L108">108</span>
610
+ <span id="L109" rel="#L109">109</span>
611
+ <span id="L110" rel="#L110">110</span>
612
+ <span id="L111" rel="#L111">111</span>
613
+ <span id="L112" rel="#L112">112</span>
614
+ <span id="L113" rel="#L113">113</span>
615
+ <span id="L114" rel="#L114">114</span>
616
+ <span id="L115" rel="#L115">115</span>
617
+ <span id="L116" rel="#L116">116</span>
618
+ <span id="L117" rel="#L117">117</span>
619
+ <span id="L118" rel="#L118">118</span>
620
+ <span id="L119" rel="#L119">119</span>
621
+ <span id="L120" rel="#L120">120</span>
622
+ <span id="L121" rel="#L121">121</span>
623
+ <span id="L122" rel="#L122">122</span>
624
+ <span id="L123" rel="#L123">123</span>
625
+ <span id="L124" rel="#L124">124</span>
626
+ <span id="L125" rel="#L125">125</span>
627
+ <span id="L126" rel="#L126">126</span>
628
+ <span id="L127" rel="#L127">127</span>
629
+ <span id="L128" rel="#L128">128</span>
630
+ <span id="L129" rel="#L129">129</span>
631
+ <span id="L130" rel="#L130">130</span>
632
+ <span id="L131" rel="#L131">131</span>
633
+ <span id="L132" rel="#L132">132</span>
634
+ <span id="L133" rel="#L133">133</span>
635
+ <span id="L134" rel="#L134">134</span>
636
+ <span id="L135" rel="#L135">135</span>
637
+ <span id="L136" rel="#L136">136</span>
638
+ <span id="L137" rel="#L137">137</span>
639
+ <span id="L138" rel="#L138">138</span>
640
+ <span id="L139" rel="#L139">139</span>
641
+ <span id="L140" rel="#L140">140</span>
642
+ <span id="L141" rel="#L141">141</span>
643
+ <span id="L142" rel="#L142">142</span>
644
+ <span id="L143" rel="#L143">143</span>
645
+ <span id="L144" rel="#L144">144</span>
646
+ <span id="L145" rel="#L145">145</span>
647
+ <span id="L146" rel="#L146">146</span>
648
+ <span id="L147" rel="#L147">147</span>
649
+ <span id="L148" rel="#L148">148</span>
650
+ <span id="L149" rel="#L149">149</span>
651
+ <span id="L150" rel="#L150">150</span>
652
+ <span id="L151" rel="#L151">151</span>
653
+ <span id="L152" rel="#L152">152</span>
654
+ <span id="L153" rel="#L153">153</span>
655
+ <span id="L154" rel="#L154">154</span>
656
+ <span id="L155" rel="#L155">155</span>
657
+ <span id="L156" rel="#L156">156</span>
658
+ <span id="L157" rel="#L157">157</span>
659
+ <span id="L158" rel="#L158">158</span>
660
+ <span id="L159" rel="#L159">159</span>
661
+ <span id="L160" rel="#L160">160</span>
662
+ <span id="L161" rel="#L161">161</span>
663
+ <span id="L162" rel="#L162">162</span>
664
+ <span id="L163" rel="#L163">163</span>
665
+ <span id="L164" rel="#L164">164</span>
666
+ <span id="L165" rel="#L165">165</span>
667
+ <span id="L166" rel="#L166">166</span>
668
+ <span id="L167" rel="#L167">167</span>
669
+ <span id="L168" rel="#L168">168</span>
670
+ <span id="L169" rel="#L169">169</span>
671
+ <span id="L170" rel="#L170">170</span>
672
+ <span id="L171" rel="#L171">171</span>
673
+ <span id="L172" rel="#L172">172</span>
674
+ <span id="L173" rel="#L173">173</span>
675
+ <span id="L174" rel="#L174">174</span>
676
+ <span id="L175" rel="#L175">175</span>
677
+ <span id="L176" rel="#L176">176</span>
678
+ <span id="L177" rel="#L177">177</span>
679
+ <span id="L178" rel="#L178">178</span>
680
+ <span id="L179" rel="#L179">179</span>
681
+ <span id="L180" rel="#L180">180</span>
682
+ <span id="L181" rel="#L181">181</span>
683
+ <span id="L182" rel="#L182">182</span>
684
+ <span id="L183" rel="#L183">183</span>
685
+ <span id="L184" rel="#L184">184</span>
686
+ <span id="L185" rel="#L185">185</span>
687
+ <span id="L186" rel="#L186">186</span>
688
+ <span id="L187" rel="#L187">187</span>
689
+ <span id="L188" rel="#L188">188</span>
690
+ <span id="L189" rel="#L189">189</span>
691
+ <span id="L190" rel="#L190">190</span>
692
+ <span id="L191" rel="#L191">191</span>
693
+ <span id="L192" rel="#L192">192</span>
694
+ <span id="L193" rel="#L193">193</span>
695
+ <span id="L194" rel="#L194">194</span>
696
+ <span id="L195" rel="#L195">195</span>
697
+ <span id="L196" rel="#L196">196</span>
698
+ <span id="L197" rel="#L197">197</span>
699
+ <span id="L198" rel="#L198">198</span>
700
+ <span id="L199" rel="#L199">199</span>
701
+ <span id="L200" rel="#L200">200</span>
702
+ <span id="L201" rel="#L201">201</span>
703
+ <span id="L202" rel="#L202">202</span>
704
+ <span id="L203" rel="#L203">203</span>
705
+ <span id="L204" rel="#L204">204</span>
706
+ <span id="L205" rel="#L205">205</span>
707
+ <span id="L206" rel="#L206">206</span>
708
+ <span id="L207" rel="#L207">207</span>
709
+ <span id="L208" rel="#L208">208</span>
710
+ <span id="L209" rel="#L209">209</span>
711
+ <span id="L210" rel="#L210">210</span>
712
+ <span id="L211" rel="#L211">211</span>
713
+ <span id="L212" rel="#L212">212</span>
714
+ <span id="L213" rel="#L213">213</span>
715
+ <span id="L214" rel="#L214">214</span>
716
+ <span id="L215" rel="#L215">215</span>
717
+ <span id="L216" rel="#L216">216</span>
718
+ <span id="L217" rel="#L217">217</span>
719
+ <span id="L218" rel="#L218">218</span>
720
+ <span id="L219" rel="#L219">219</span>
721
+ <span id="L220" rel="#L220">220</span>
722
+ <span id="L221" rel="#L221">221</span>
723
+ <span id="L222" rel="#L222">222</span>
724
+ <span id="L223" rel="#L223">223</span>
725
+ <span id="L224" rel="#L224">224</span>
726
+ <span id="L225" rel="#L225">225</span>
727
+ <span id="L226" rel="#L226">226</span>
728
+ <span id="L227" rel="#L227">227</span>
729
+ <span id="L228" rel="#L228">228</span>
730
+ <span id="L229" rel="#L229">229</span>
731
+ <span id="L230" rel="#L230">230</span>
732
+ <span id="L231" rel="#L231">231</span>
733
+ <span id="L232" rel="#L232">232</span>
734
+ <span id="L233" rel="#L233">233</span>
735
+ <span id="L234" rel="#L234">234</span>
736
+ <span id="L235" rel="#L235">235</span>
737
+ <span id="L236" rel="#L236">236</span>
738
+ <span id="L237" rel="#L237">237</span>
739
+ <span id="L238" rel="#L238">238</span>
740
+ <span id="L239" rel="#L239">239</span>
741
+ <span id="L240" rel="#L240">240</span>
742
+ <span id="L241" rel="#L241">241</span>
743
+ <span id="L242" rel="#L242">242</span>
744
+ <span id="L243" rel="#L243">243</span>
745
+ <span id="L244" rel="#L244">244</span>
746
+ <span id="L245" rel="#L245">245</span>
747
+ <span id="L246" rel="#L246">246</span>
748
+ <span id="L247" rel="#L247">247</span>
749
+ <span id="L248" rel="#L248">248</span>
750
+ <span id="L249" rel="#L249">249</span>
751
+ <span id="L250" rel="#L250">250</span>
752
+ <span id="L251" rel="#L251">251</span>
753
+ <span id="L252" rel="#L252">252</span>
754
+ <span id="L253" rel="#L253">253</span>
755
+ <span id="L254" rel="#L254">254</span>
756
+ <span id="L255" rel="#L255">255</span>
757
+ <span id="L256" rel="#L256">256</span>
758
+ <span id="L257" rel="#L257">257</span>
759
+ <span id="L258" rel="#L258">258</span>
760
+ <span id="L259" rel="#L259">259</span>
761
+ <span id="L260" rel="#L260">260</span>
762
+ <span id="L261" rel="#L261">261</span>
763
+ <span id="L262" rel="#L262">262</span>
764
+ <span id="L263" rel="#L263">263</span>
765
+ <span id="L264" rel="#L264">264</span>
766
+ <span id="L265" rel="#L265">265</span>
767
+ <span id="L266" rel="#L266">266</span>
768
+ <span id="L267" rel="#L267">267</span>
769
+ <span id="L268" rel="#L268">268</span>
770
+ <span id="L269" rel="#L269">269</span>
771
+ <span id="L270" rel="#L270">270</span>
772
+ <span id="L271" rel="#L271">271</span>
773
+ <span id="L272" rel="#L272">272</span>
774
+ <span id="L273" rel="#L273">273</span>
775
+ <span id="L274" rel="#L274">274</span>
776
+ <span id="L275" rel="#L275">275</span>
777
+ <span id="L276" rel="#L276">276</span>
778
+ <span id="L277" rel="#L277">277</span>
779
+ <span id="L278" rel="#L278">278</span>
780
+ <span id="L279" rel="#L279">279</span>
781
+ <span id="L280" rel="#L280">280</span>
782
+ <span id="L281" rel="#L281">281</span>
783
+ <span id="L282" rel="#L282">282</span>
784
+ <span id="L283" rel="#L283">283</span>
785
+ <span id="L284" rel="#L284">284</span>
786
+ <span id="L285" rel="#L285">285</span>
787
+ <span id="L286" rel="#L286">286</span>
788
+ <span id="L287" rel="#L287">287</span>
789
+ <span id="L288" rel="#L288">288</span>
790
+ <span id="L289" rel="#L289">289</span>
791
+ <span id="L290" rel="#L290">290</span>
792
+ <span id="L291" rel="#L291">291</span>
793
+ <span id="L292" rel="#L292">292</span>
794
+ <span id="L293" rel="#L293">293</span>
795
+ <span id="L294" rel="#L294">294</span>
796
+ <span id="L295" rel="#L295">295</span>
797
+ <span id="L296" rel="#L296">296</span>
798
+ <span id="L297" rel="#L297">297</span>
799
+ <span id="L298" rel="#L298">298</span>
800
+ <span id="L299" rel="#L299">299</span>
801
+ <span id="L300" rel="#L300">300</span>
802
+ <span id="L301" rel="#L301">301</span>
803
+ <span id="L302" rel="#L302">302</span>
804
+ <span id="L303" rel="#L303">303</span>
805
+ <span id="L304" rel="#L304">304</span>
806
+ <span id="L305" rel="#L305">305</span>
807
+ <span id="L306" rel="#L306">306</span>
808
+ <span id="L307" rel="#L307">307</span>
809
+ <span id="L308" rel="#L308">308</span>
810
+ <span id="L309" rel="#L309">309</span>
811
+ <span id="L310" rel="#L310">310</span>
812
+ <span id="L311" rel="#L311">311</span>
813
+ <span id="L312" rel="#L312">312</span>
814
+ <span id="L313" rel="#L313">313</span>
815
+ <span id="L314" rel="#L314">314</span>
816
+ <span id="L315" rel="#L315">315</span>
817
+ <span id="L316" rel="#L316">316</span>
818
+ <span id="L317" rel="#L317">317</span>
819
+ <span id="L318" rel="#L318">318</span>
820
+ <span id="L319" rel="#L319">319</span>
821
+ <span id="L320" rel="#L320">320</span>
822
+ <span id="L321" rel="#L321">321</span>
823
+ <span id="L322" rel="#L322">322</span>
824
+ <span id="L323" rel="#L323">323</span>
825
+ <span id="L324" rel="#L324">324</span>
826
+ <span id="L325" rel="#L325">325</span>
827
+ <span id="L326" rel="#L326">326</span>
828
+ <span id="L327" rel="#L327">327</span>
829
+ <span id="L328" rel="#L328">328</span>
830
+ <span id="L329" rel="#L329">329</span>
831
+ <span id="L330" rel="#L330">330</span>
832
+ <span id="L331" rel="#L331">331</span>
833
+ <span id="L332" rel="#L332">332</span>
834
+ <span id="L333" rel="#L333">333</span>
835
+ <span id="L334" rel="#L334">334</span>
836
+ <span id="L335" rel="#L335">335</span>
837
+ <span id="L336" rel="#L336">336</span>
838
+ <span id="L337" rel="#L337">337</span>
839
+ <span id="L338" rel="#L338">338</span>
840
+ <span id="L339" rel="#L339">339</span>
841
+ <span id="L340" rel="#L340">340</span>
842
+ <span id="L341" rel="#L341">341</span>
843
+ <span id="L342" rel="#L342">342</span>
844
+ <span id="L343" rel="#L343">343</span>
845
+ <span id="L344" rel="#L344">344</span>
846
+ <span id="L345" rel="#L345">345</span>
847
+ <span id="L346" rel="#L346">346</span>
848
+ <span id="L347" rel="#L347">347</span>
849
+ <span id="L348" rel="#L348">348</span>
850
+ <span id="L349" rel="#L349">349</span>
851
+ <span id="L350" rel="#L350">350</span>
852
+ <span id="L351" rel="#L351">351</span>
853
+ <span id="L352" rel="#L352">352</span>
854
+ <span id="L353" rel="#L353">353</span>
855
+ <span id="L354" rel="#L354">354</span>
856
+ <span id="L355" rel="#L355">355</span>
857
+ <span id="L356" rel="#L356">356</span>
858
+ <span id="L357" rel="#L357">357</span>
859
+ <span id="L358" rel="#L358">358</span>
860
+ <span id="L359" rel="#L359">359</span>
861
+ <span id="L360" rel="#L360">360</span>
862
+ <span id="L361" rel="#L361">361</span>
863
+ <span id="L362" rel="#L362">362</span>
864
+ <span id="L363" rel="#L363">363</span>
865
+ <span id="L364" rel="#L364">364</span>
866
+ <span id="L365" rel="#L365">365</span>
867
+ <span id="L366" rel="#L366">366</span>
868
+ <span id="L367" rel="#L367">367</span>
869
+ <span id="L368" rel="#L368">368</span>
870
+ <span id="L369" rel="#L369">369</span>
871
+ <span id="L370" rel="#L370">370</span>
872
+ <span id="L371" rel="#L371">371</span>
873
+ <span id="L372" rel="#L372">372</span>
874
+ <span id="L373" rel="#L373">373</span>
875
+ <span id="L374" rel="#L374">374</span>
876
+ <span id="L375" rel="#L375">375</span>
877
+ <span id="L376" rel="#L376">376</span>
878
+ <span id="L377" rel="#L377">377</span>
879
+ <span id="L378" rel="#L378">378</span>
880
+ <span id="L379" rel="#L379">379</span>
881
+ <span id="L380" rel="#L380">380</span>
882
+ <span id="L381" rel="#L381">381</span>
883
+ <span id="L382" rel="#L382">382</span>
884
+ <span id="L383" rel="#L383">383</span>
885
+ <span id="L384" rel="#L384">384</span>
886
+ <span id="L385" rel="#L385">385</span>
887
+ <span id="L386" rel="#L386">386</span>
888
+ <span id="L387" rel="#L387">387</span>
889
+ <span id="L388" rel="#L388">388</span>
890
+ <span id="L389" rel="#L389">389</span>
891
+ <span id="L390" rel="#L390">390</span>
892
+ <span id="L391" rel="#L391">391</span>
893
+ <span id="L392" rel="#L392">392</span>
894
+ <span id="L393" rel="#L393">393</span>
895
+ <span id="L394" rel="#L394">394</span>
896
+ <span id="L395" rel="#L395">395</span>
897
+ <span id="L396" rel="#L396">396</span>
898
+ <span id="L397" rel="#L397">397</span>
899
+ <span id="L398" rel="#L398">398</span>
900
+ <span id="L399" rel="#L399">399</span>
901
+ <span id="L400" rel="#L400">400</span>
902
+ <span id="L401" rel="#L401">401</span>
903
+ <span id="L402" rel="#L402">402</span>
904
+ <span id="L403" rel="#L403">403</span>
905
+ <span id="L404" rel="#L404">404</span>
906
+ <span id="L405" rel="#L405">405</span>
907
+ <span id="L406" rel="#L406">406</span>
908
+ <span id="L407" rel="#L407">407</span>
909
+ <span id="L408" rel="#L408">408</span>
910
+ <span id="L409" rel="#L409">409</span>
911
+ <span id="L410" rel="#L410">410</span>
912
+ <span id="L411" rel="#L411">411</span>
913
+ <span id="L412" rel="#L412">412</span>
914
+ <span id="L413" rel="#L413">413</span>
915
+ <span id="L414" rel="#L414">414</span>
916
+ <span id="L415" rel="#L415">415</span>
917
+ <span id="L416" rel="#L416">416</span>
918
+ <span id="L417" rel="#L417">417</span>
919
+ <span id="L418" rel="#L418">418</span>
920
+ <span id="L419" rel="#L419">419</span>
921
+ <span id="L420" rel="#L420">420</span>
922
+ <span id="L421" rel="#L421">421</span>
923
+ <span id="L422" rel="#L422">422</span>
924
+ <span id="L423" rel="#L423">423</span>
925
+ <span id="L424" rel="#L424">424</span>
926
+ <span id="L425" rel="#L425">425</span>
927
+ <span id="L426" rel="#L426">426</span>
928
+ <span id="L427" rel="#L427">427</span>
929
+ <span id="L428" rel="#L428">428</span>
930
+ <span id="L429" rel="#L429">429</span>
931
+ <span id="L430" rel="#L430">430</span>
932
+ <span id="L431" rel="#L431">431</span>
933
+ <span id="L432" rel="#L432">432</span>
934
+ <span id="L433" rel="#L433">433</span>
935
+ <span id="L434" rel="#L434">434</span>
936
+ <span id="L435" rel="#L435">435</span>
937
+ <span id="L436" rel="#L436">436</span>
938
+ <span id="L437" rel="#L437">437</span>
939
+ <span id="L438" rel="#L438">438</span>
940
+ <span id="L439" rel="#L439">439</span>
941
+ <span id="L440" rel="#L440">440</span>
942
+ <span id="L441" rel="#L441">441</span>
943
+ <span id="L442" rel="#L442">442</span>
944
+ <span id="L443" rel="#L443">443</span>
945
+ <span id="L444" rel="#L444">444</span>
946
+ <span id="L445" rel="#L445">445</span>
947
+ <span id="L446" rel="#L446">446</span>
948
+ <span id="L447" rel="#L447">447</span>
949
+ <span id="L448" rel="#L448">448</span>
950
+ <span id="L449" rel="#L449">449</span>
951
+ <span id="L450" rel="#L450">450</span>
952
+ <span id="L451" rel="#L451">451</span>
953
+ <span id="L452" rel="#L452">452</span>
954
+ <span id="L453" rel="#L453">453</span>
955
+ <span id="L454" rel="#L454">454</span>
956
+ <span id="L455" rel="#L455">455</span>
957
+ <span id="L456" rel="#L456">456</span>
958
+ <span id="L457" rel="#L457">457</span>
959
+ <span id="L458" rel="#L458">458</span>
960
+ <span id="L459" rel="#L459">459</span>
961
+ <span id="L460" rel="#L460">460</span>
962
+ <span id="L461" rel="#L461">461</span>
963
+ <span id="L462" rel="#L462">462</span>
964
+ <span id="L463" rel="#L463">463</span>
965
+ <span id="L464" rel="#L464">464</span>
966
+ <span id="L465" rel="#L465">465</span>
967
+ <span id="L466" rel="#L466">466</span>
968
+ <span id="L467" rel="#L467">467</span>
969
+ <span id="L468" rel="#L468">468</span>
970
+ <span id="L469" rel="#L469">469</span>
971
+ <span id="L470" rel="#L470">470</span>
972
+ <span id="L471" rel="#L471">471</span>
973
+ <span id="L472" rel="#L472">472</span>
974
+ <span id="L473" rel="#L473">473</span>
975
+ <span id="L474" rel="#L474">474</span>
976
+ <span id="L475" rel="#L475">475</span>
977
+ <span id="L476" rel="#L476">476</span>
978
+ <span id="L477" rel="#L477">477</span>
979
+ <span id="L478" rel="#L478">478</span>
980
+ <span id="L479" rel="#L479">479</span>
981
+ <span id="L480" rel="#L480">480</span>
982
+ <span id="L481" rel="#L481">481</span>
983
+ <span id="L482" rel="#L482">482</span>
984
+ <span id="L483" rel="#L483">483</span>
985
+ <span id="L484" rel="#L484">484</span>
986
+ <span id="L485" rel="#L485">485</span>
987
+ <span id="L486" rel="#L486">486</span>
988
+ <span id="L487" rel="#L487">487</span>
989
+ <span id="L488" rel="#L488">488</span>
990
+ <span id="L489" rel="#L489">489</span>
991
+ <span id="L490" rel="#L490">490</span>
992
+ <span id="L491" rel="#L491">491</span>
993
+ <span id="L492" rel="#L492">492</span>
994
+ <span id="L493" rel="#L493">493</span>
995
+ <span id="L494" rel="#L494">494</span>
996
+ <span id="L495" rel="#L495">495</span>
997
+ <span id="L496" rel="#L496">496</span>
998
+ <span id="L497" rel="#L497">497</span>
999
+ <span id="L498" rel="#L498">498</span>
1000
+ <span id="L499" rel="#L499">499</span>
1001
+ <span id="L500" rel="#L500">500</span>
1002
+ <span id="L501" rel="#L501">501</span>
1003
+ <span id="L502" rel="#L502">502</span>
1004
+ <span id="L503" rel="#L503">503</span>
1005
+ <span id="L504" rel="#L504">504</span>
1006
+ <span id="L505" rel="#L505">505</span>
1007
+ <span id="L506" rel="#L506">506</span>
1008
+ <span id="L507" rel="#L507">507</span>
1009
+ <span id="L508" rel="#L508">508</span>
1010
+ <span id="L509" rel="#L509">509</span>
1011
+ <span id="L510" rel="#L510">510</span>
1012
+ <span id="L511" rel="#L511">511</span>
1013
+ <span id="L512" rel="#L512">512</span>
1014
+ <span id="L513" rel="#L513">513</span>
1015
+ <span id="L514" rel="#L514">514</span>
1016
+ <span id="L515" rel="#L515">515</span>
1017
+ <span id="L516" rel="#L516">516</span>
1018
+ <span id="L517" rel="#L517">517</span>
1019
+ <span id="L518" rel="#L518">518</span>
1020
+ <span id="L519" rel="#L519">519</span>
1021
+ <span id="L520" rel="#L520">520</span>
1022
+ <span id="L521" rel="#L521">521</span>
1023
+ <span id="L522" rel="#L522">522</span>
1024
+ <span id="L523" rel="#L523">523</span>
1025
+ <span id="L524" rel="#L524">524</span>
1026
+ <span id="L525" rel="#L525">525</span>
1027
+ <span id="L526" rel="#L526">526</span>
1028
+ <span id="L527" rel="#L527">527</span>
1029
+ <span id="L528" rel="#L528">528</span>
1030
+ <span id="L529" rel="#L529">529</span>
1031
+ <span id="L530" rel="#L530">530</span>
1032
+ <span id="L531" rel="#L531">531</span>
1033
+ <span id="L532" rel="#L532">532</span>
1034
+ <span id="L533" rel="#L533">533</span>
1035
+ <span id="L534" rel="#L534">534</span>
1036
+ <span id="L535" rel="#L535">535</span>
1037
+ <span id="L536" rel="#L536">536</span>
1038
+ <span id="L537" rel="#L537">537</span>
1039
+ <span id="L538" rel="#L538">538</span>
1040
+ <span id="L539" rel="#L539">539</span>
1041
+ <span id="L540" rel="#L540">540</span>
1042
+ <span id="L541" rel="#L541">541</span>
1043
+ <span id="L542" rel="#L542">542</span>
1044
+ <span id="L543" rel="#L543">543</span>
1045
+ <span id="L544" rel="#L544">544</span>
1046
+ <span id="L545" rel="#L545">545</span>
1047
+ <span id="L546" rel="#L546">546</span>
1048
+ <span id="L547" rel="#L547">547</span>
1049
+ <span id="L548" rel="#L548">548</span>
1050
+ <span id="L549" rel="#L549">549</span>
1051
+ <span id="L550" rel="#L550">550</span>
1052
+ <span id="L551" rel="#L551">551</span>
1053
+ <span id="L552" rel="#L552">552</span>
1054
+ <span id="L553" rel="#L553">553</span>
1055
+ <span id="L554" rel="#L554">554</span>
1056
+ <span id="L555" rel="#L555">555</span>
1057
+ <span id="L556" rel="#L556">556</span>
1058
+ <span id="L557" rel="#L557">557</span>
1059
+ <span id="L558" rel="#L558">558</span>
1060
+ <span id="L559" rel="#L559">559</span>
1061
+ <span id="L560" rel="#L560">560</span>
1062
+ <span id="L561" rel="#L561">561</span>
1063
+ <span id="L562" rel="#L562">562</span>
1064
+ <span id="L563" rel="#L563">563</span>
1065
+ <span id="L564" rel="#L564">564</span>
1066
+ <span id="L565" rel="#L565">565</span>
1067
+ <span id="L566" rel="#L566">566</span>
1068
+ <span id="L567" rel="#L567">567</span>
1069
+ <span id="L568" rel="#L568">568</span>
1070
+ <span id="L569" rel="#L569">569</span>
1071
+ <span id="L570" rel="#L570">570</span>
1072
+ <span id="L571" rel="#L571">571</span>
1073
+ <span id="L572" rel="#L572">572</span>
1074
+ <span id="L573" rel="#L573">573</span>
1075
+ <span id="L574" rel="#L574">574</span>
1076
+ <span id="L575" rel="#L575">575</span>
1077
+ <span id="L576" rel="#L576">576</span>
1078
+ <span id="L577" rel="#L577">577</span>
1079
+ <span id="L578" rel="#L578">578</span>
1080
+ <span id="L579" rel="#L579">579</span>
1081
+ <span id="L580" rel="#L580">580</span>
1082
+ <span id="L581" rel="#L581">581</span>
1083
+ <span id="L582" rel="#L582">582</span>
1084
+ <span id="L583" rel="#L583">583</span>
1085
+ <span id="L584" rel="#L584">584</span>
1086
+ <span id="L585" rel="#L585">585</span>
1087
+ <span id="L586" rel="#L586">586</span>
1088
+ <span id="L587" rel="#L587">587</span>
1089
+ <span id="L588" rel="#L588">588</span>
1090
+ <span id="L589" rel="#L589">589</span>
1091
+ <span id="L590" rel="#L590">590</span>
1092
+ <span id="L591" rel="#L591">591</span>
1093
+ <span id="L592" rel="#L592">592</span>
1094
+ <span id="L593" rel="#L593">593</span>
1095
+ <span id="L594" rel="#L594">594</span>
1096
+ <span id="L595" rel="#L595">595</span>
1097
+ <span id="L596" rel="#L596">596</span>
1098
+ <span id="L597" rel="#L597">597</span>
1099
+ <span id="L598" rel="#L598">598</span>
1100
+ <span id="L599" rel="#L599">599</span>
1101
+ <span id="L600" rel="#L600">600</span>
1102
+ <span id="L601" rel="#L601">601</span>
1103
+ <span id="L602" rel="#L602">602</span>
1104
+ <span id="L603" rel="#L603">603</span>
1105
+ <span id="L604" rel="#L604">604</span>
1106
+ <span id="L605" rel="#L605">605</span>
1107
+ </pre>
1108
+ </td>
1109
+ <td width="100%">
1110
+
1111
+
1112
+ <div class="highlight"><pre><div class='line' id='LC1'><span class="cm">/*</span></div><div class='line' id='LC2'><span class="cm">/*</span></div><div class='line' id='LC3'><span class="cm">Copyright 2006 Adobe Systems Incorporated</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="cm">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;),</span></div><div class='line' id='LC6'><span class="cm">to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div><div class='line' id='LC7'><span class="cm">and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</span></div><div class='line' id='LC8'><br/></div><div class='line' id='LC9'><span class="cm"> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</span></div><div class='line' id='LC10'><br/></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'><span class="cm">THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class='line' id='LC13'><span class="cm">FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class='line' id='LC14'><span class="cm">LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE</span></div><div class='line' id='LC15'><span class="cm">OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'><span class="cm">*/</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'><span class="cm">/*</span></div><div class='line' id='LC21'><span class="cm"> * The Bridge class, responsible for navigating AS instances</span></div><div class='line' id='LC22'><span class="cm"> */</span></div><div class='line' id='LC23'><span class="kd">function</span> <span class="nx">FABridge</span><span class="p">(</span><span class="nx">target</span><span class="p">,</span><span class="nx">bridgeName</span><span class="p">)</span></div><div class='line' id='LC24'><span class="p">{</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="p">;</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteTypeCache</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteInstanceCache</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteFunctionCache</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">localFunctionCache</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC30'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridgeID</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">nextBridgeID</span><span class="o">++</span><span class="p">;</span></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="nx">bridgeName</span><span class="p">;</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">nextLocalFuncID</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">instances</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">idMap</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">bridgeID</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC37'><span class="p">}</span></div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'><span class="c1">// type codes for packed values</span></div><div class='line' id='LC40'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ASINSTANCE</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span></div><div class='line' id='LC41'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ASFUNCTION</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span></div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_JSFUNCTION</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span></div><div class='line' id='LC44'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ANONYMOUS</span> <span class="o">=</span> <span class="mi">4</span><span class="p">;</span></div><div class='line' id='LC45'><br/></div><div class='line' id='LC46'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">initCallbacks</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC47'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">userTypes</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">addToUserTypes</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC50'><span class="p">{</span></div><div class='line' id='LC51'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC52'> <span class="p">{</span></div><div class='line' id='LC53'> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">userTypes</span><span class="p">[</span><span class="nx">arguments</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="p">{</span></div><div class='line' id='LC54'> <span class="s1">&#39;typeName&#39;</span><span class="o">:</span> <span class="nx">arguments</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> </div><div class='line' id='LC55'> <span class="s1">&#39;enriched&#39;</span><span class="o">:</span> <span class="kc">false</span></div><div class='line' id='LC56'> <span class="p">};</span></div><div class='line' id='LC57'> <span class="p">}</span></div><div class='line' id='LC58'><span class="p">}</span></div><div class='line' id='LC59'><br/></div><div class='line' id='LC60'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">argsToArray</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC61'><span class="p">{</span></div><div class='line' id='LC62'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">result</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC63'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">args</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC64'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC65'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span></div><div class='line' id='LC66'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC67'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC68'><span class="p">}</span></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'><span class="kd">function</span> <span class="nx">instanceFactory</span><span class="p">(</span><span class="nx">objID</span><span class="p">)</span></div><div class='line' id='LC71'><span class="p">{</span></div><div class='line' id='LC72'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span> <span class="o">=</span> <span class="nx">objID</span><span class="p">;</span></div><div class='line' id='LC73'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC74'><span class="p">}</span></div><div class='line' id='LC75'><br/></div><div class='line' id='LC76'><span class="kd">function</span> <span class="nx">FABridge__invokeJSFunction</span><span class="p">(</span><span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC77'><span class="p">{</span> </div><div class='line' id='LC78'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">funcID</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span></div><div class='line' id='LC79'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">throughArgs</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">concat</span><span class="p">();</span><span class="c1">//FABridge.argsToArray(arguments);</span></div><div class='line' id='LC80'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">throughArgs</span><span class="p">.</span><span class="nx">shift</span><span class="p">();</span></div><div class='line' id='LC81'>&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC82'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">bridge</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">extractBridgeFromID</span><span class="p">(</span><span class="nx">funcID</span><span class="p">);</span></div><div class='line' id='LC83'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">bridge</span><span class="p">.</span><span class="nx">invokeLocalFunction</span><span class="p">(</span><span class="nx">funcID</span><span class="p">,</span> <span class="nx">throughArgs</span><span class="p">);</span></div><div class='line' id='LC84'><span class="p">}</span></div><div class='line' id='LC85'><br/></div><div class='line' id='LC86'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">addInitializationCallback</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">bridgeName</span><span class="p">,</span> <span class="nx">callback</span><span class="p">)</span></div><div class='line' id='LC87'><span class="p">{</span></div><div class='line' id='LC88'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">inst</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">instances</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">];</span></div><div class='line' id='LC89'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">inst</span> <span class="o">!=</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC90'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC91'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">callback</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">inst</span><span class="p">);</span></div><div class='line' id='LC92'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span><span class="p">;</span></div><div class='line' id='LC93'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC94'><br/></div><div class='line' id='LC95'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">callbackList</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">initCallbacks</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">];</span></div><div class='line' id='LC96'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span><span class="p">(</span><span class="nx">callbackList</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span></div><div class='line' id='LC97'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC98'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">initCallbacks</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">]</span> <span class="o">=</span> <span class="nx">callbackList</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC99'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC100'><br/></div><div class='line' id='LC101'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">callbackList</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">callback</span><span class="p">);</span></div><div class='line' id='LC102'><span class="p">}</span></div><div class='line' id='LC103'><br/></div><div class='line' id='LC104'><span class="c1">// updated for changes to SWFObject2</span></div><div class='line' id='LC105'><span class="kd">function</span> <span class="nx">FABridge__bridgeInitialized</span><span class="p">(</span><span class="nx">bridgeName</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC106'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">objects</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;object&quot;</span><span class="p">);</span></div><div class='line' id='LC107'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">ol</span> <span class="o">=</span> <span class="nx">objects</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span></div><div class='line' id='LC108'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">activeObjects</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC109'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">ol</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC110'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">ol</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC111'> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">objects</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">SetVariable</span> <span class="o">!=</span> <span class="s2">&quot;undefined&quot;</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC112'> <span class="nx">activeObjects</span><span class="p">[</span><span class="nx">activeObjects</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">objects</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span></div><div class='line' id='LC113'> <span class="p">}</span></div><div class='line' id='LC114'> <span class="p">}</span></div><div class='line' id='LC115'> <span class="p">}</span></div><div class='line' id='LC116'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">embeds</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;embed&quot;</span><span class="p">);</span></div><div class='line' id='LC117'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">embeds</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span></div><div class='line' id='LC118'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">activeEmbeds</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC119'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">el</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC120'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">el</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC121'> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">embeds</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">SetVariable</span> <span class="o">!=</span> <span class="s2">&quot;undefined&quot;</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC122'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="nx">activeEmbeds</span><span class="p">[</span><span class="nx">activeEmbeds</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">embeds</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span></div><div class='line' id='LC123'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC124'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC125'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC126'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">aol</span> <span class="o">=</span> <span class="nx">activeObjects</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span></div><div class='line' id='LC127'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">ael</span> <span class="o">=</span> <span class="nx">activeEmbeds</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span></div><div class='line' id='LC128'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">searchStr</span> <span class="o">=</span> <span class="s2">&quot;bridgeName=&quot;</span><span class="o">+</span> <span class="nx">bridgeName</span><span class="p">;</span></div><div class='line' id='LC129'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">((</span><span class="nx">aol</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">ael</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">aol</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="nx">ael</span> <span class="o">==</span> <span class="mi">1</span><span class="p">))</span> <span class="p">{</span></div><div class='line' id='LC130'>&nbsp;&nbsp;&nbsp;&nbsp; <span class="nx">FABridge</span><span class="p">.</span><span class="nx">attachBridge</span><span class="p">(</span><span class="nx">activeObjects</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">bridgeName</span><span class="p">);</span> </div><div class='line' id='LC131'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC132'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">ael</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">aol</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC133'>&nbsp;&nbsp;&nbsp;&nbsp; <span class="nx">FABridge</span><span class="p">.</span><span class="nx">attachBridge</span><span class="p">(</span><span class="nx">activeEmbeds</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">bridgeName</span><span class="p">);</span></div><div class='line' id='LC134'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC135'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="p">{</span></div><div class='line' id='LC136'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">flash_found</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span></div><div class='line' id='LC137'> <span class="k">if</span> <span class="p">(</span><span class="nx">aol</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC138'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">k</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">k</span> <span class="o">&lt;</span> <span class="nx">aol</span><span class="p">;</span> <span class="nx">k</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC139'> <span class="kd">var</span> <span class="nx">params</span> <span class="o">=</span> <span class="nx">activeObjects</span><span class="p">[</span><span class="nx">k</span><span class="p">].</span><span class="nx">childNodes</span><span class="p">;</span></div><div class='line' id='LC140'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">l</span> <span class="o">&lt;</span> <span class="nx">params</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">l</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC141'> <span class="kd">var</span> <span class="nx">param</span> <span class="o">=</span> <span class="nx">params</span><span class="p">[</span><span class="nx">l</span><span class="p">];</span></div><div class='line' id='LC142'> <span class="k">if</span> <span class="p">(</span><span class="nx">param</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="nx">param</span><span class="p">.</span><span class="nx">tagName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;param&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">param</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">].</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;flashvars&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">param</span><span class="p">[</span><span class="s2">&quot;value&quot;</span><span class="p">].</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">searchStr</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC143'> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">attachBridge</span><span class="p">(</span><span class="nx">activeObjects</span><span class="p">[</span><span class="nx">k</span><span class="p">],</span> <span class="nx">bridgeName</span><span class="p">);</span></div><div class='line' id='LC144'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">flash_found</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span></div><div class='line' id='LC145'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">break</span><span class="p">;</span></div><div class='line' id='LC146'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC147'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC148'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">flash_found</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC149'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">break</span><span class="p">;</span></div><div class='line' id='LC150'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC151'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC152'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC153'> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">flash_found</span> <span class="o">&amp;&amp;</span> <span class="nx">ael</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC154'> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">m</span> <span class="o">&lt;</span> <span class="nx">ael</span><span class="p">;</span> <span class="nx">m</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC155'> <span class="kd">var</span> <span class="nx">flashVars</span> <span class="o">=</span> <span class="nx">activeEmbeds</span><span class="p">[</span><span class="nx">m</span><span class="p">].</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">getNamedItem</span><span class="p">(</span><span class="s2">&quot;flashVars&quot;</span><span class="p">).</span><span class="nx">nodeValue</span><span class="p">;</span></div><div class='line' id='LC156'> <span class="k">if</span> <span class="p">(</span><span class="nx">flashVars</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">searchStr</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC157'> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">attachBridge</span><span class="p">(</span><span class="nx">activeEmbeds</span><span class="p">[</span><span class="nx">m</span><span class="p">],</span> <span class="nx">bridgeName</span><span class="p">);</span></div><div class='line' id='LC158'> <span class="k">break</span><span class="p">;</span></div><div class='line' id='LC159'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC160'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC161'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC162'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC163'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="kc">true</span><span class="p">;</span></div><div class='line' id='LC164'><span class="p">}</span></div><div class='line' id='LC165'><br/></div><div class='line' id='LC166'><span class="c1">// used to track multiple bridge instances, since callbacks from AS are global across the page.</span></div><div class='line' id='LC167'><br/></div><div class='line' id='LC168'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">nextBridgeID</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span></div><div class='line' id='LC169'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">instances</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC170'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">idMap</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC171'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span></div><div class='line' id='LC172'><br/></div><div class='line' id='LC173'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">extractBridgeFromID</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span></div><div class='line' id='LC174'><span class="p">{</span></div><div class='line' id='LC175'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">bridgeID</span> <span class="o">=</span> <span class="p">(</span><span class="nx">id</span> <span class="o">&gt;&gt;</span> <span class="mi">16</span><span class="p">);</span></div><div class='line' id='LC176'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">idMap</span><span class="p">[</span><span class="nx">bridgeID</span><span class="p">];</span></div><div class='line' id='LC177'><span class="p">}</span></div><div class='line' id='LC178'><br/></div><div class='line' id='LC179'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">attachBridge</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">instance</span><span class="p">,</span> <span class="nx">bridgeName</span><span class="p">)</span></div><div class='line' id='LC180'><span class="p">{</span></div><div class='line' id='LC181'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">newBridgeInstance</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FABridge</span><span class="p">(</span><span class="nx">instance</span><span class="p">,</span> <span class="nx">bridgeName</span><span class="p">);</span></div><div class='line' id='LC182'><br/></div><div class='line' id='LC183'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">]</span> <span class="o">=</span> <span class="nx">newBridgeInstance</span><span class="p">;</span></div><div class='line' id='LC184'><br/></div><div class='line' id='LC185'><span class="cm">/* FABridge[bridgeName] = function() {</span></div><div class='line' id='LC186'><span class="cm"> return newBridgeInstance.root();</span></div><div class='line' id='LC187'><span class="cm"> }</span></div><div class='line' id='LC188'><span class="cm">*/</span></div><div class='line' id='LC189'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">callbacks</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">initCallbacks</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">];</span></div><div class='line' id='LC190'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">callbacks</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span></div><div class='line' id='LC191'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC192'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span><span class="p">;</span></div><div class='line' id='LC193'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC194'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">callbacks</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC195'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC196'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">callbacks</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">call</span><span class="p">(</span><span class="nx">newBridgeInstance</span><span class="p">);</span></div><div class='line' id='LC197'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC198'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">delete</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">initCallbacks</span><span class="p">[</span><span class="nx">bridgeName</span><span class="p">]</span></div><div class='line' id='LC199'><span class="p">}</span></div><div class='line' id='LC200'><br/></div><div class='line' id='LC201'><span class="c1">// some methods can&#39;t be proxied. You can use the explicit get,set, and call methods if necessary.</span></div><div class='line' id='LC202'><br/></div><div class='line' id='LC203'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">blockedMethods</span> <span class="o">=</span></div><div class='line' id='LC204'><span class="p">{</span></div><div class='line' id='LC205'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">toString</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span></div><div class='line' id='LC206'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">get</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span></div><div class='line' id='LC207'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">set</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span></div><div class='line' id='LC208'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">call</span><span class="o">:</span> <span class="kc">true</span></div><div class='line' id='LC209'><span class="p">};</span></div><div class='line' id='LC210'><br/></div><div class='line' id='LC211'><span class="nx">FABridge</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span></div><div class='line' id='LC212'><span class="p">{</span></div><div class='line' id='LC213'><br/></div><div class='line' id='LC214'><br/></div><div class='line' id='LC215'><span class="c1">// bootstrapping</span></div><div class='line' id='LC216'><br/></div><div class='line' id='LC217'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">root</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC218'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC219'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">getRoot</span><span class="p">());</span></div><div class='line' id='LC220'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC221'><span class="c1">//clears all of the AS objects in the cache maps</span></div><div class='line' id='LC222'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">releaseASObjects</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC223'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC224'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">releaseASObjects</span><span class="p">();</span></div><div class='line' id='LC225'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC226'><span class="c1">//clears a specific object in AS from the type maps</span></div><div class='line' id='LC227'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">releaseNamedASObject</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span></div><div class='line' id='LC228'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC229'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span><span class="p">(</span><span class="k">typeof</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;object&quot;</span><span class="p">)</span></div><div class='line' id='LC230'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC231'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="kc">false</span><span class="p">;</span></div><div class='line' id='LC232'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC233'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC234'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC235'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">releaseNamedASObject</span><span class="p">(</span><span class="nx">value</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">);</span></div><div class='line' id='LC236'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">ret</span><span class="p">;</span></div><div class='line' id='LC237'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC238'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC239'><span class="c1">//create a new AS Object</span></div><div class='line' id='LC240'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">create</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">className</span><span class="p">)</span></div><div class='line' id='LC241'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC242'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="nx">className</span><span class="p">));</span></div><div class='line' id='LC243'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC244'><br/></div><div class='line' id='LC245'><br/></div><div class='line' id='LC246'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// utilities</span></div><div class='line' id='LC247'><br/></div><div class='line' id='LC248'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">makeID</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">token</span><span class="p">)</span></div><div class='line' id='LC249'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC250'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">bridgeID</span> <span class="o">&lt;&lt;</span> <span class="mi">16</span><span class="p">)</span> <span class="o">+</span> <span class="nx">token</span><span class="p">;</span></div><div class='line' id='LC251'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC252'><br/></div><div class='line' id='LC253'><br/></div><div class='line' id='LC254'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// low level access to the flash object</span></div><div class='line' id='LC255'><br/></div><div class='line' id='LC256'><span class="c1">//get a named property from an AS object</span></div><div class='line' id='LC257'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getPropertyFromAS</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objRef</span><span class="p">,</span> <span class="nx">propName</span><span class="p">)</span></div><div class='line' id='LC258'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC259'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC260'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC261'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.&quot;</span><span class="p">);</span></div><div class='line' id='LC262'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC263'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC264'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC265'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">++</span><span class="p">;</span></div><div class='line' id='LC266'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">getPropFromAS</span><span class="p">(</span><span class="nx">objRef</span><span class="p">,</span> <span class="nx">propName</span><span class="p">);</span></div><div class='line' id='LC267'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleError</span><span class="p">(</span><span class="nx">retVal</span><span class="p">);</span></div><div class='line' id='LC268'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">--</span><span class="p">;</span></div><div class='line' id='LC269'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">retVal</span><span class="p">;</span></div><div class='line' id='LC270'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC271'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC272'><span class="c1">//set a named property on an AS object</span></div><div class='line' id='LC273'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">setPropertyInAS</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objRef</span><span class="p">,</span><span class="nx">propName</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span></div><div class='line' id='LC274'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC275'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC276'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC277'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.&quot;</span><span class="p">);</span></div><div class='line' id='LC278'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC279'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC280'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC281'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">++</span><span class="p">;</span></div><div class='line' id='LC282'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">setPropInAS</span><span class="p">(</span><span class="nx">objRef</span><span class="p">,</span><span class="nx">propName</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">value</span><span class="p">));</span></div><div class='line' id='LC283'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleError</span><span class="p">(</span><span class="nx">retVal</span><span class="p">);</span></div><div class='line' id='LC284'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">--</span><span class="p">;</span></div><div class='line' id='LC285'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">retVal</span><span class="p">;</span></div><div class='line' id='LC286'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC287'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC288'><br/></div><div class='line' id='LC289'><span class="c1">//call an AS function</span></div><div class='line' id='LC290'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">callASFunction</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">funcID</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC291'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC292'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC293'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC294'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.&quot;</span><span class="p">);</span></div><div class='line' id='LC295'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC296'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC297'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC298'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">++</span><span class="p">;</span></div><div class='line' id='LC299'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">invokeASFunction</span><span class="p">(</span><span class="nx">funcID</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">args</span><span class="p">));</span></div><div class='line' id='LC300'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleError</span><span class="p">(</span><span class="nx">retVal</span><span class="p">);</span></div><div class='line' id='LC301'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">--</span><span class="p">;</span></div><div class='line' id='LC302'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">retVal</span><span class="p">;</span></div><div class='line' id='LC303'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC304'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC305'><span class="c1">//call a method on an AS object</span></div><div class='line' id='LC306'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">callASMethod</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objID</span><span class="p">,</span> <span class="nx">funcName</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC307'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC308'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC309'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC310'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.&quot;</span><span class="p">);</span></div><div class='line' id='LC311'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC312'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC313'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC314'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">++</span><span class="p">;</span></div><div class='line' id='LC315'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">args</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">args</span><span class="p">);</span></div><div class='line' id='LC316'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">invokeASMethod</span><span class="p">(</span><span class="nx">objID</span><span class="p">,</span> <span class="nx">funcName</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span></div><div class='line' id='LC317'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">retVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleError</span><span class="p">(</span><span class="nx">retVal</span><span class="p">);</span></div><div class='line' id='LC318'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">--</span><span class="p">;</span></div><div class='line' id='LC319'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">retVal</span><span class="p">;</span></div><div class='line' id='LC320'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC321'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC322'><br/></div><div class='line' id='LC323'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// responders to remote calls from flash</span></div><div class='line' id='LC324'><br/></div><div class='line' id='LC325'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//callback from flash that executes a local JS function</span></div><div class='line' id='LC326'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//used mostly when setting js functions as callbacks on events</span></div><div class='line' id='LC327'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">invokeLocalFunction</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">funcID</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC328'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC329'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC330'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">func</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">localFunctionCache</span><span class="p">[</span><span class="nx">funcID</span><span class="p">];</span></div><div class='line' id='LC331'><br/></div><div class='line' id='LC332'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span><span class="p">(</span><span class="nx">func</span> <span class="o">!=</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC333'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC334'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">func</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="nx">args</span><span class="p">)));</span></div><div class='line' id='LC335'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC336'><br/></div><div class='line' id='LC337'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC338'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC339'><br/></div><div class='line' id='LC340'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Object Types and Proxies</span></div><div class='line' id='LC341'><br/></div><div class='line' id='LC342'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// accepts an object reference, returns a type object matching the obj reference.</span></div><div class='line' id='LC343'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getTypeFromName</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objTypeName</span><span class="p">)</span></div><div class='line' id='LC344'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC345'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">remoteTypeCache</span><span class="p">[</span><span class="nx">objTypeName</span><span class="p">];</span></div><div class='line' id='LC346'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC347'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//create an AS proxy for the given object ID and type</span></div><div class='line' id='LC348'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">createProxy</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objID</span><span class="p">,</span> <span class="nx">typeName</span><span class="p">)</span></div><div class='line' id='LC349'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC350'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">objType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTypeFromName</span><span class="p">(</span><span class="nx">typeName</span><span class="p">);</span></div><div class='line' id='LC351'> <span class="nx">instanceFactory</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="nx">objType</span><span class="p">;</span></div><div class='line' id='LC352'> <span class="kd">var</span> <span class="nx">instance</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">instanceFactory</span><span class="p">(</span><span class="nx">objID</span><span class="p">);</span></div><div class='line' id='LC353'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteInstanceCache</span><span class="p">[</span><span class="nx">objID</span><span class="p">]</span> <span class="o">=</span> <span class="nx">instance</span><span class="p">;</span></div><div class='line' id='LC354'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">instance</span><span class="p">;</span></div><div class='line' id='LC355'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC356'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//return the proxy associated with the given object ID</span></div><div class='line' id='LC357'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getProxy</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">objID</span><span class="p">)</span></div><div class='line' id='LC358'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC359'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">remoteInstanceCache</span><span class="p">[</span><span class="nx">objID</span><span class="p">];</span></div><div class='line' id='LC360'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC361'><br/></div><div class='line' id='LC362'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// accepts a type structure, returns a constructed type</span></div><div class='line' id='LC363'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">addTypeDataToCache</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">typeData</span><span class="p">)</span></div><div class='line' id='LC364'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC365'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">newType</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ASProxy</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">typeData</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span></div><div class='line' id='LC366'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">accessors</span> <span class="o">=</span> <span class="nx">typeData</span><span class="p">.</span><span class="nx">accessors</span><span class="p">;</span></div><div class='line' id='LC367'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">accessors</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC368'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC369'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">addPropertyToType</span><span class="p">(</span><span class="nx">newType</span><span class="p">,</span> <span class="nx">accessors</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span></div><div class='line' id='LC370'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC371'><br/></div><div class='line' id='LC372'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">methods</span> <span class="o">=</span> <span class="nx">typeData</span><span class="p">.</span><span class="nx">methods</span><span class="p">;</span></div><div class='line' id='LC373'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">methods</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC374'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC375'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">blockedMethods</span><span class="p">[</span><span class="nx">methods</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">==</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC376'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC377'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">addMethodToType</span><span class="p">(</span><span class="nx">newType</span><span class="p">,</span> <span class="nx">methods</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span></div><div class='line' id='LC378'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC379'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC380'><br/></div><div class='line' id='LC381'><br/></div><div class='line' id='LC382'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteTypeCache</span><span class="p">[</span><span class="nx">newType</span><span class="p">.</span><span class="nx">typeName</span><span class="p">]</span> <span class="o">=</span> <span class="nx">newType</span><span class="p">;</span></div><div class='line' id='LC383'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">newType</span><span class="p">;</span></div><div class='line' id='LC384'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC385'><br/></div><div class='line' id='LC386'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//add a property to a typename; used to define the properties that can be called on an AS proxied object</span></div><div class='line' id='LC387'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">addPropertyToType</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ty</span><span class="p">,</span> <span class="nx">propName</span><span class="p">)</span></div><div class='line' id='LC388'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC389'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">c</span> <span class="o">=</span> <span class="nx">propName</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span></div><div class='line' id='LC390'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">setterName</span><span class="p">;</span></div><div class='line' id='LC391'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">getterName</span><span class="p">;</span></div><div class='line' id='LC392'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span><span class="p">(</span><span class="nx">c</span> <span class="o">&gt;=</span> <span class="s2">&quot;a&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">c</span> <span class="o">&lt;=</span> <span class="s2">&quot;z&quot;</span><span class="p">)</span></div><div class='line' id='LC393'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC394'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getterName</span> <span class="o">=</span> <span class="s2">&quot;get&quot;</span> <span class="o">+</span> <span class="nx">c</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">+</span> <span class="nx">propName</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span></div><div class='line' id='LC395'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">setterName</span> <span class="o">=</span> <span class="s2">&quot;set&quot;</span> <span class="o">+</span> <span class="nx">c</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">+</span> <span class="nx">propName</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span></div><div class='line' id='LC396'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC397'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC398'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC399'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getterName</span> <span class="o">=</span> <span class="s2">&quot;get&quot;</span> <span class="o">+</span> <span class="nx">propName</span><span class="p">;</span></div><div class='line' id='LC400'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">setterName</span> <span class="o">=</span> <span class="s2">&quot;set&quot;</span> <span class="o">+</span> <span class="nx">propName</span><span class="p">;</span></div><div class='line' id='LC401'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC402'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">ty</span><span class="p">[</span><span class="nx">setterName</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">val</span><span class="p">)</span></div><div class='line' id='LC403'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC404'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">setPropertyInAS</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">propName</span><span class="p">,</span> <span class="nx">val</span><span class="p">);</span></div><div class='line' id='LC405'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC406'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">ty</span><span class="p">[</span><span class="nx">getterName</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC407'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC408'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">getPropertyFromAS</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">propName</span><span class="p">));</span></div><div class='line' id='LC409'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC410'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC411'><br/></div><div class='line' id='LC412'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//add a method to a typename; used to define the methods that can be callefd on an AS proxied object</span></div><div class='line' id='LC413'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">addMethodToType</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ty</span><span class="p">,</span> <span class="nx">methodName</span><span class="p">)</span></div><div class='line' id='LC414'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC415'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">ty</span><span class="p">[</span><span class="nx">methodName</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC416'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC417'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">callASMethod</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">methodName</span><span class="p">,</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">argsToArray</span><span class="p">(</span><span class="nx">arguments</span><span class="p">)));</span></div><div class='line' id='LC418'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC419'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC420'><br/></div><div class='line' id='LC421'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Function Proxies</span></div><div class='line' id='LC422'><br/></div><div class='line' id='LC423'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//returns the AS proxy for the specified function ID</span></div><div class='line' id='LC424'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getFunctionProxy</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">funcID</span><span class="p">)</span></div><div class='line' id='LC425'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC426'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">bridge</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC427'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">remoteFunctionCache</span><span class="p">[</span><span class="nx">funcID</span><span class="p">]</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span></div><div class='line' id='LC428'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC429'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">remoteFunctionCache</span><span class="p">[</span><span class="nx">funcID</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span></div><div class='line' id='LC430'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC431'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">bridge</span><span class="p">.</span><span class="nx">callASFunction</span><span class="p">(</span><span class="nx">funcID</span><span class="p">,</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">argsToArray</span><span class="p">(</span><span class="nx">arguments</span><span class="p">));</span></div><div class='line' id='LC432'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC433'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC434'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">remoteFunctionCache</span><span class="p">[</span><span class="nx">funcID</span><span class="p">];</span></div><div class='line' id='LC435'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC436'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC437'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//reutrns the ID of the given function; if it doesnt exist it is created and added to the local cache</span></div><div class='line' id='LC438'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">getFunctionID</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">func</span><span class="p">)</span></div><div class='line' id='LC439'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC440'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">func</span><span class="p">.</span><span class="nx">__bridge_id__</span> <span class="o">==</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC441'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC442'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">func</span><span class="p">.</span><span class="nx">__bridge_id__</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">makeID</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">nextLocalFuncID</span><span class="o">++</span><span class="p">);</span></div><div class='line' id='LC443'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">localFunctionCache</span><span class="p">[</span><span class="nx">func</span><span class="p">.</span><span class="nx">__bridge_id__</span><span class="p">]</span> <span class="o">=</span> <span class="nx">func</span><span class="p">;</span></div><div class='line' id='LC444'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC445'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">func</span><span class="p">.</span><span class="nx">__bridge_id__</span><span class="p">;</span></div><div class='line' id='LC446'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC447'><br/></div><div class='line' id='LC448'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// serialization / deserialization</span></div><div class='line' id='LC449'><br/></div><div class='line' id='LC450'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">serialize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span></div><div class='line' id='LC451'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC452'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">result</span> <span class="o">=</span> <span class="p">{};</span></div><div class='line' id='LC453'><br/></div><div class='line' id='LC454'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">typeof</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span></div><div class='line' id='LC455'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//primitives are kept as such</span></div><div class='line' id='LC456'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;number&quot;</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;string&quot;</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;boolean&quot;</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC457'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC458'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC459'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC460'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="k">instanceof</span> <span class="nb">Array</span><span class="p">)</span></div><div class='line' id='LC461'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC462'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//arrays are serializesd recursively</span></div><div class='line' id='LC463'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC464'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">value</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC465'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC466'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">value</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span></div><div class='line' id='LC467'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC468'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC469'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;function&quot;</span><span class="p">)</span></div><div class='line' id='LC470'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC471'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//js functions are assigned an ID and stored in the local cache </span></div><div class='line' id='LC472'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_JSFUNCTION</span><span class="p">;</span></div><div class='line' id='LC473'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getFunctionID</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span></div><div class='line' id='LC474'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC475'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="k">instanceof</span> <span class="nx">ASProxy</span><span class="p">)</span></div><div class='line' id='LC476'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC477'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ASINSTANCE</span><span class="p">;</span></div><div class='line' id='LC478'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">value</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">;</span></div><div class='line' id='LC479'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC480'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC481'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC482'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ANONYMOUS</span><span class="p">;</span></div><div class='line' id='LC483'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC484'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC485'><br/></div><div class='line' id='LC486'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC487'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC488'><br/></div><div class='line' id='LC489'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//on deserialization we always check the return for the specific error code that is used to marshall NPE&#39;s into JS errors</span></div><div class='line' id='LC490'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// the unpacking is done by returning the value on each pachet for objects/arrays </span></div><div class='line' id='LC491'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">deserialize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">)</span></div><div class='line' id='LC492'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC493'><br/></div><div class='line' id='LC494'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC495'><br/></div><div class='line' id='LC496'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="k">typeof</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">);</span></div><div class='line' id='LC497'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;number&quot;</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;string&quot;</span> <span class="o">||</span> <span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;boolean&quot;</span> <span class="o">||</span> <span class="nx">packedValue</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">||</span> <span class="nx">packedValue</span> <span class="o">==</span> <span class="kc">undefined</span><span class="p">)</span></div><div class='line' id='LC498'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC499'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleError</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">);</span></div><div class='line' id='LC500'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC501'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">packedValue</span> <span class="k">instanceof</span> <span class="nb">Array</span><span class="p">)</span></div><div class='line' id='LC502'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC503'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="p">[];</span></div><div class='line' id='LC504'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC505'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC506'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span></div><div class='line' id='LC507'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC508'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC509'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">t</span> <span class="o">==</span> <span class="s2">&quot;object&quot;</span><span class="p">)</span></div><div class='line' id='LC510'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC511'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">newTypes</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC512'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC513'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">addTypeDataToCache</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">newTypes</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span></div><div class='line' id='LC514'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC515'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">aRefID</span> <span class="k">in</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">newRefs</span><span class="p">)</span></div><div class='line' id='LC516'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC517'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">createProxy</span><span class="p">(</span><span class="nx">aRefID</span><span class="p">,</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">newRefs</span><span class="p">[</span><span class="nx">aRefID</span><span class="p">]);</span></div><div class='line' id='LC518'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC519'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_PRIMITIVE</span><span class="p">)</span></div><div class='line' id='LC520'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC521'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC522'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC523'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ASFUNCTION</span><span class="p">)</span></div><div class='line' id='LC524'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC525'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getFunctionProxy</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span></div><div class='line' id='LC526'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC527'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ASINSTANCE</span><span class="p">)</span></div><div class='line' id='LC528'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC529'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getProxy</span><span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span></div><div class='line' id='LC530'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC531'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">packedValue</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="nx">FABridge</span><span class="p">.</span><span class="nx">TYPE_ANONYMOUS</span><span class="p">)</span></div><div class='line' id='LC532'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC533'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">result</span> <span class="o">=</span> <span class="nx">packedValue</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC534'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC535'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC536'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">result</span><span class="p">;</span></div><div class='line' id='LC537'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC538'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//increases the reference count for the given object</span></div><div class='line' id='LC539'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">addRef</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span></div><div class='line' id='LC540'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC541'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">incRef</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">);</span></div><div class='line' id='LC542'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC543'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">//decrease the reference count for the given object and release it if needed</span></div><div class='line' id='LC544'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">release</span><span class="o">:</span><span class="kd">function</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span></div><div class='line' id='LC545'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC546'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">target</span><span class="p">.</span><span class="nx">releaseRef</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">);</span></div><div class='line' id='LC547'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC548'><br/></div><div class='line' id='LC549'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// check the given value for the components of the hard-coded error code : __FLASHERROR</span></div><div class='line' id='LC550'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// used to marshall NPE&#39;s into flash</span></div><div class='line' id='LC551'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC552'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">handleError</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span></div><div class='line' id='LC553'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC554'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="k">typeof</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span><span class="o">==</span><span class="s2">&quot;string&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">value</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s2">&quot;__FLASHERROR&quot;</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">)</span></div><div class='line' id='LC555'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC556'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">myErrorMessage</span> <span class="o">=</span> <span class="nx">value</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s2">&quot;||&quot;</span><span class="p">);</span></div><div class='line' id='LC557'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span><span class="p">(</span><span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="p">)</span></div><div class='line' id='LC558'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC559'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">FABridge</span><span class="p">.</span><span class="nx">refCount</span><span class="o">--</span><span class="p">;</span></div><div class='line' id='LC560'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC561'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="nx">myErrorMessage</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span></div><div class='line' id='LC562'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC563'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC564'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">else</span></div><div class='line' id='LC565'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC566'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">value</span><span class="p">;</span></div><div class='line' id='LC567'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span> </div><div class='line' id='LC568'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC569'><span class="p">};</span></div><div class='line' id='LC570'><br/></div><div class='line' id='LC571'><span class="c1">// The root ASProxy class that facades a flash object</span></div><div class='line' id='LC572'><br/></div><div class='line' id='LC573'><span class="nx">ASProxy</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">bridge</span><span class="p">,</span> <span class="nx">typeName</span><span class="p">)</span></div><div class='line' id='LC574'><span class="p">{</span></div><div class='line' id='LC575'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span> <span class="o">=</span> <span class="nx">bridge</span><span class="p">;</span></div><div class='line' id='LC576'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">typeName</span> <span class="o">=</span> <span class="nx">typeName</span><span class="p">;</span></div><div class='line' id='LC577'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">;</span></div><div class='line' id='LC578'><span class="p">};</span></div><div class='line' id='LC579'><span class="c1">//methods available on each ASProxy object</span></div><div class='line' id='LC580'><span class="nx">ASProxy</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span></div><div class='line' id='LC581'><span class="p">{</span></div><div class='line' id='LC582'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">get</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">propName</span><span class="p">)</span></div><div class='line' id='LC583'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC584'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">deserialize</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">getPropertyFromAS</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">propName</span><span class="p">));</span></div><div class='line' id='LC585'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC586'><br/></div><div class='line' id='LC587'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">set</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">propName</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span></div><div class='line' id='LC588'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC589'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">setPropertyInAS</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">propName</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span></div><div class='line' id='LC590'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span></div><div class='line' id='LC591'><br/></div><div class='line' id='LC592'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">call</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">funcName</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span></div><div class='line' id='LC593'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC594'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">callASMethod</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">fb_instance_id</span><span class="p">,</span> <span class="nx">funcName</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span></div><div class='line' id='LC595'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span> </div><div class='line' id='LC596'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC597'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">addRef</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></div><div class='line' id='LC598'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">addRef</span><span class="p">(</span><span class="k">this</span><span class="p">);</span></div><div class='line' id='LC599'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">},</span> </div><div class='line' id='LC600'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC601'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">release</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></div><div class='line' id='LC602'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="p">.</span><span class="nx">bridge</span><span class="p">.</span><span class="nx">release</span><span class="p">(</span><span class="k">this</span><span class="p">);</span></div><div class='line' id='LC603'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC604'><span class="p">};</span></div><div class='line' id='LC605'><br/></div></pre></div>
1113
+
1114
+
1115
+ </td>
1116
+ </tr>
1117
+ </table>
1118
+
1119
+ </div>
1120
+
1121
+
1122
+ </div>
1123
+ </div>
1124
+ </div>
1125
+ </div>
1126
+
1127
+
1128
+ </div>
1129
+
1130
+
1131
+ <div class="frame frame-loading" style="display:none;">
1132
+ <img src="/images/modules/ajax/big_spinner_336699.gif">
1133
+ </div>
1134
+
1135
+ </div>
1136
+
1137
+
1138
+ </div>
1139
+
1140
+ <div id="footer" class="clearfix">
1141
+ <div class="site">
1142
+ <div class="sponsor">
1143
+ <a href="http://www.rackspace.com" class="logo">
1144
+ <img alt="Dedicated Server" src="https://assets1.github.com/images/modules/footer/rackspace_logo.png?v2?fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a" />
1145
+ </a>
1146
+ Powered by the <a href="http://www.rackspace.com ">Dedicated
1147
+ Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
1148
+ Computing</a> of Rackspace Hosting<span>&reg;</span>
1149
+ </div>
1150
+
1151
+ <ul class="links">
1152
+ <li class="blog"><a href="https://github.com/blog">Blog</a></li>
1153
+ <li><a href="http://support.github.com">Support</a></li>
1154
+ <li><a href="https://github.com/training">Training</a></li>
1155
+ <li><a href="http://jobs.github.com">Job Board</a></li>
1156
+ <li><a href="http://shop.github.com">Shop</a></li>
1157
+ <li><a href="https://github.com/contact">Contact</a></li>
1158
+ <li><a href="http://develop.github.com">API</a></li>
1159
+ <li><a href="http://status.github.com">Status</a></li>
1160
+ </ul>
1161
+ <ul class="sosueme">
1162
+ <li class="main">&copy; 2011 <span id="_rrt" title="0.07977s from fe6.rs.github.com">GitHub</span> Inc. All rights reserved.</li>
1163
+ <li><a href="/site/terms">Terms of Service</a></li>
1164
+ <li><a href="/site/privacy">Privacy</a></li>
1165
+ <li><a href="https://github.com/security">Security</a></li>
1166
+ </ul>
1167
+ </div>
1168
+ </div><!-- /#footer -->
1169
+
1170
+
1171
+
1172
+
1173
+ <!-- current locale: -->
1174
+ <div class="locales">
1175
+ <div class="site">
1176
+
1177
+ <ul class="choices clearfix limited-locales">
1178
+ <li><span class="current">English</span></li>
1179
+
1180
+ <li><a rel="nofollow" href="?locale=de">Deutsch</a></li>
1181
+
1182
+ <li><a rel="nofollow" href="?locale=fr">Français</a></li>
1183
+
1184
+ <li><a rel="nofollow" href="?locale=ja">日本語</a></li>
1185
+
1186
+ <li><a rel="nofollow" href="?locale=pt-BR">Português (BR)</a></li>
1187
+
1188
+ <li><a rel="nofollow" href="?locale=ru">Русский</a></li>
1189
+
1190
+ <li><a rel="nofollow" href="?locale=zh">中文</a></li>
1191
+
1192
+ <li class="all"><a href="#" class="minibutton btn-forward js-all-locales"><span><span class="icon"></span>See all available languages</span></a></li>
1193
+ </ul>
1194
+
1195
+ <div class="all-locales clearfix">
1196
+ <h3>Your current locale selection: <strong>English</strong>. Choose another?</h3>
1197
+
1198
+
1199
+ <ul class="choices">
1200
+
1201
+ <li><a rel="nofollow" href="?locale=en">English</a></li>
1202
+
1203
+ <li><a rel="nofollow" href="?locale=af">Afrikaans</a></li>
1204
+
1205
+ <li><a rel="nofollow" href="?locale=ca">Català</a></li>
1206
+
1207
+ <li><a rel="nofollow" href="?locale=cs">Čeština</a></li>
1208
+
1209
+ </ul>
1210
+
1211
+ <ul class="choices">
1212
+
1213
+ <li><a rel="nofollow" href="?locale=de">Deutsch</a></li>
1214
+
1215
+ <li><a rel="nofollow" href="?locale=es">Español</a></li>
1216
+
1217
+ <li><a rel="nofollow" href="?locale=fr">Français</a></li>
1218
+
1219
+ <li><a rel="nofollow" href="?locale=hr">Hrvatski</a></li>
1220
+
1221
+ </ul>
1222
+
1223
+ <ul class="choices">
1224
+
1225
+ <li><a rel="nofollow" href="?locale=id">Indonesia</a></li>
1226
+
1227
+ <li><a rel="nofollow" href="?locale=it">Italiano</a></li>
1228
+
1229
+ <li><a rel="nofollow" href="?locale=ja">日本語</a></li>
1230
+
1231
+ <li><a rel="nofollow" href="?locale=nl">Nederlands</a></li>
1232
+
1233
+ </ul>
1234
+
1235
+ <ul class="choices">
1236
+
1237
+ <li><a rel="nofollow" href="?locale=no">Norsk</a></li>
1238
+
1239
+ <li><a rel="nofollow" href="?locale=pl">Polski</a></li>
1240
+
1241
+ <li><a rel="nofollow" href="?locale=pt-BR">Português (BR)</a></li>
1242
+
1243
+ <li><a rel="nofollow" href="?locale=ru">Русский</a></li>
1244
+
1245
+ </ul>
1246
+
1247
+ <ul class="choices">
1248
+
1249
+ <li><a rel="nofollow" href="?locale=sr">Српски</a></li>
1250
+
1251
+ <li><a rel="nofollow" href="?locale=sv">Svenska</a></li>
1252
+
1253
+ <li><a rel="nofollow" href="?locale=zh">中文</a></li>
1254
+
1255
+ </ul>
1256
+
1257
+ </div>
1258
+
1259
+ </div>
1260
+ <div class="fade"></div>
1261
+ </div>
1262
+
1263
+
1264
+
1265
+ <script>window._auth_token = "a704e3e9a52a8249af74f3ff2cb305c3d839fd8e"</script>
1266
+ <div id="keyboard_shortcuts_pane" style="display:none">
1267
+ <h2>Keyboard Shortcuts</h2>
1268
+
1269
+ <div class="columns threecols">
1270
+ <div class="column first">
1271
+ <h3>Site wide shortcuts</h3>
1272
+ <dl class="keyboard-mappings">
1273
+ <dt>s</dt>
1274
+ <dd>Focus site search</dd>
1275
+ </dl>
1276
+ <dl class="keyboard-mappings">
1277
+ <dt>?</dt>
1278
+ <dd>Bring up this help dialog</dd>
1279
+ </dl>
1280
+ </div><!-- /.column.first -->
1281
+ <div class="column middle">
1282
+ <h3>Commit list</h3>
1283
+ <dl class="keyboard-mappings">
1284
+ <dt>j</dt>
1285
+ <dd>Move selected down</dd>
1286
+ </dl>
1287
+ <dl class="keyboard-mappings">
1288
+ <dt>k</dt>
1289
+ <dd>Move selected up</dd>
1290
+ </dl>
1291
+ <dl class="keyboard-mappings">
1292
+ <dt>t</dt>
1293
+ <dd>Open tree</dd>
1294
+ </dl>
1295
+ <dl class="keyboard-mappings">
1296
+ <dt>p</dt>
1297
+ <dd>Open parent</dd>
1298
+ </dl>
1299
+ <dl class="keyboard-mappings">
1300
+ <dt>c <em>or</em> o <em>or</em> enter</dt>
1301
+ <dd>Open commit</dd>
1302
+ </dl>
1303
+ </div><!-- /.column.first -->
1304
+ <div class="column last">
1305
+ <h3>Pull request list</h3>
1306
+ <dl class="keyboard-mappings">
1307
+ <dt>j</dt>
1308
+ <dd>Move selected down</dd>
1309
+ </dl>
1310
+ <dl class="keyboard-mappings">
1311
+ <dt>k</dt>
1312
+ <dd>Move selected up</dd>
1313
+ </dl>
1314
+ <dl class="keyboard-mappings">
1315
+ <dt>o <em>or</em> enter</dt>
1316
+ <dd>Open issue</dd>
1317
+ </dl>
1318
+ </div><!-- /.columns.last -->
1319
+ </div><!-- /.columns.equacols -->
1320
+
1321
+ <div class="rule"></div>
1322
+
1323
+ <h3>Issues</h3>
1324
+
1325
+ <div class="columns threecols">
1326
+ <div class="column first">
1327
+ <dl class="keyboard-mappings">
1328
+ <dt>j</dt>
1329
+ <dd>Move selected down</dd>
1330
+ </dl>
1331
+ <dl class="keyboard-mappings">
1332
+ <dt>k</dt>
1333
+ <dd>Move selected up</dd>
1334
+ </dl>
1335
+ <dl class="keyboard-mappings">
1336
+ <dt>x</dt>
1337
+ <dd>Toggle select target</dd>
1338
+ </dl>
1339
+ <dl class="keyboard-mappings">
1340
+ <dt>o <em>or</em> enter</dt>
1341
+ <dd>Open issue</dd>
1342
+ </dl>
1343
+ </div><!-- /.column.first -->
1344
+ <div class="column middle">
1345
+ <dl class="keyboard-mappings">
1346
+ <dt>I</dt>
1347
+ <dd>Mark selected as read</dd>
1348
+ </dl>
1349
+ <dl class="keyboard-mappings">
1350
+ <dt>U</dt>
1351
+ <dd>Mark selected as unread</dd>
1352
+ </dl>
1353
+ <dl class="keyboard-mappings">
1354
+ <dt>e</dt>
1355
+ <dd>Close selected</dd>
1356
+ </dl>
1357
+ <dl class="keyboard-mappings">
1358
+ <dt>y</dt>
1359
+ <dd>Remove selected from view</dd>
1360
+ </dl>
1361
+ </div><!-- /.column.middle -->
1362
+ <div class="column last">
1363
+ <dl class="keyboard-mappings">
1364
+ <dt>c</dt>
1365
+ <dd>Create issue</dd>
1366
+ </dl>
1367
+ <dl class="keyboard-mappings">
1368
+ <dt>l</dt>
1369
+ <dd>Create label</dd>
1370
+ </dl>
1371
+ <dl class="keyboard-mappings">
1372
+ <dt>i</dt>
1373
+ <dd>Back to inbox</dd>
1374
+ </dl>
1375
+ <dl class="keyboard-mappings">
1376
+ <dt>u</dt>
1377
+ <dd>Back to issues</dd>
1378
+ </dl>
1379
+ <dl class="keyboard-mappings">
1380
+ <dt>/</dt>
1381
+ <dd>Focus issues search</dd>
1382
+ </dl>
1383
+ </div>
1384
+ </div>
1385
+
1386
+ <div class="rule"></div>
1387
+
1388
+ <h3>Network Graph</h3>
1389
+ <div class="columns equacols">
1390
+ <div class="column first">
1391
+ <dl class="keyboard-mappings">
1392
+ <dt>← <em>or</em> h</dt>
1393
+ <dd>Scroll left</dd>
1394
+ </dl>
1395
+ <dl class="keyboard-mappings">
1396
+ <dt>→ <em>or</em> l</dt>
1397
+ <dd>Scroll right</dd>
1398
+ </dl>
1399
+ <dl class="keyboard-mappings">
1400
+ <dt>↑ <em>or</em> k</dt>
1401
+ <dd>Scroll up</dd>
1402
+ </dl>
1403
+ <dl class="keyboard-mappings">
1404
+ <dt>↓ <em>or</em> j</dt>
1405
+ <dd>Scroll down</dd>
1406
+ </dl>
1407
+ <dl class="keyboard-mappings">
1408
+ <dt>t</dt>
1409
+ <dd>Toggle visibility of head labels</dd>
1410
+ </dl>
1411
+ </div><!-- /.column.first -->
1412
+ <div class="column last">
1413
+ <dl class="keyboard-mappings">
1414
+ <dt>shift ← <em>or</em> shift h</dt>
1415
+ <dd>Scroll all the way left</dd>
1416
+ </dl>
1417
+ <dl class="keyboard-mappings">
1418
+ <dt>shift → <em>or</em> shift l</dt>
1419
+ <dd>Scroll all the way right</dd>
1420
+ </dl>
1421
+ <dl class="keyboard-mappings">
1422
+ <dt>shift ↑ <em>or</em> shift k</dt>
1423
+ <dd>Scroll all the way up</dd>
1424
+ </dl>
1425
+ <dl class="keyboard-mappings">
1426
+ <dt>shift ↓ <em>or</em> shift j</dt>
1427
+ <dd>Scroll all the way down</dd>
1428
+ </dl>
1429
+ </div><!-- /.column.last -->
1430
+ </div>
1431
+
1432
+ </div>
1433
+
1434
+
1435
+ <!--[if IE 8]>
1436
+ <script type="text/javascript" charset="utf-8">
1437
+ $(document.body).addClass("ie8")
1438
+ </script>
1439
+ <![endif]-->
1440
+
1441
+ <!--[if IE 7]>
1442
+ <script type="text/javascript" charset="utf-8">
1443
+ $(document.body).addClass("ie7")
1444
+ </script>
1445
+ <![endif]-->
1446
+
1447
+
1448
+ <script type='text/javascript'></script>
1449
+
1450
+ </body>
1451
+ </html>
1452
+