3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.air.NativeObservable"></div>/**
\r
9 * @class Ext.air.NativeObservable
\r
10 * @extends Ext.util.Observable
\r
12 * Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers
\r
17 Ext.air.NativeObservable = Ext.extend(Ext.util.Observable, {
\r
18 addListener : function(name){
\r
19 this.proxiedEvents = this.proxiedEvents || {};
\r
20 if(!this.proxiedEvents[name]){
\r
21 var instance = this;
\r
23 var args = Array.prototype.slice.call(arguments, 0);
\r
25 instance.fireEvent.apply(instance, args);
\r
27 this.proxiedEvents[name] = f;
\r
28 this.getNative().addEventListener(name, f);
\r
30 Ext.air.NativeObservable.superclass.addListener.apply(this, arguments);
\r
34 Ext.air.NativeObservable.prototype.on = Ext.air.NativeObservable.prototype.addListener;</pre>
\r