Show
Ignore:
Timestamp:
05/17/09 16:48:18 (4 years ago)
Author:
kawa0117
Message:

HTML5.Audio tab

Location:
lang/javascript/HTML5.Audio/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/HTML5.Audio/trunk/examples/player.html

    r33382 r33383  
    88<script type="text/javascript"><!-- 
    99 
    10         HTML5.Audio.Proxy.getProxy({swfPath:'../swf/html5-audio.swf'}); 
     10    HTML5.Audio.Proxy.getProxy({swfPath:'../swf/html5-audio.swf'}); 
    1111 
    12         var music; 
    13         function play (url) { 
    14                 music = new HTML5.Audio(url); 
    15                 music.play(); 
    16         } 
    17         function stop () { 
    18                 if ( ! music ) return; 
    19                 music.pause(); 
    20         } 
     12    var music; 
     13    function play (url) { 
     14        music = new HTML5.Audio(url); 
     15        music.play(); 
     16    } 
     17    function stop () { 
     18        if ( ! music ) return; 
     19        music.pause(); 
     20    } 
    2121 
    2222--></script> 
  • lang/javascript/HTML5.Audio/trunk/examples/simple.html

    r33382 r33383  
    88<script type="text/javascript"><!-- 
    99 
    10         HTML5.Audio.Proxy.getProxy({swfPath:'../swf/html5-audio.swf',onready: init}); 
     10    HTML5.Audio.Proxy.getProxy({swfPath:'../swf/html5-audio.swf',onready: init}); 
    1111 
    1212    var music; 
    13         function init () { 
    14                 var url = '../sounds/kik.mp3'; 
    15                 music = new HTML5.Audio(url); 
    16         } 
     13    function init () { 
     14        var url = '../sounds/kik.mp3'; 
     15        music = new HTML5.Audio(url); 
     16    } 
    1717 
    18         function play () { 
    19                 music.play(); 
    20         } 
     18    function play () { 
     19        music.play(); 
     20    } 
    2121 
    2222--></script> 
  • lang/javascript/HTML5.Audio/trunk/js/html5-audio.js

    r33379 r33383  
    2626 */ 
    2727 
    28 //      global 
     28//  global 
    2929 
    3030if ( ! window.HTML5 ) HTML5 = {}; 
    3131 
    3232if ( ! HTML5.Audio ) { 
    33         HTML5.Audio = function ( url ) { 
    34             this.proxy = HTML5.Audio.Proxy.getProxy(); 
    35                 this.create( url ); 
    36         }; 
    37         HTML5.Audio.prototype = new JKL.JS2AS.Item(); 
    38         HTML5.Audio.prototype.play = function () { 
    39                 return this.call( 'play' ); 
    40         } 
    41         HTML5.Audio.prototype.pause = function () { 
    42                 return this.call( 'pause' ); 
    43         } 
     33    HTML5.Audio = function ( url ) { 
     34        this.proxy = HTML5.Audio.Proxy.getProxy(); 
     35        this.create( url ); 
     36    }; 
     37    HTML5.Audio.prototype = new JKL.JS2AS.Item(); 
     38    HTML5.Audio.prototype.play = function () { 
     39        return this.call( 'play' ); 
     40    } 
     41    HTML5.Audio.prototype.pause = function () { 
     42        return this.call( 'pause' ); 
     43    } 
    4444} 
    4545 
     
    4747 
    4848if ( ! HTML5.Audio.Proxy ) { 
    49         HTML5.Audio.Proxy = function () { 
    50                 if ( HTML5.Audio.Proxy._instance && JKL.Console.error ) { 
    51                         JKL.Console.error( 'HTML5.Audio.Proxy is a singleton.' ); 
    52                 } 
    53                 return this; 
    54         }; 
    55         HTML5.Audio.Proxy.prototype = new JKL.JS2AS(); 
    56         HTML5.Audio.Proxy.prototype.swfPath     = '../swf/html5-audio.swf'; 
    57         HTML5.Audio.Proxy.prototype.installPath = '../swf/expressInstall.swf'; 
    58         HTML5.Audio.Proxy.prototype.className   = 'HTML5_Audio'; 
     49    HTML5.Audio.Proxy = function () { 
     50        if ( HTML5.Audio.Proxy._instance && JKL.Console.error ) { 
     51            JKL.Console.error( 'HTML5.Audio.Proxy is a singleton.' ); 
     52        } 
     53        return this; 
     54    }; 
     55    HTML5.Audio.Proxy.prototype = new JKL.JS2AS(); 
     56    HTML5.Audio.Proxy.prototype.swfPath     = '../swf/html5-audio.swf'; 
     57    HTML5.Audio.Proxy.prototype.installPath = '../swf/expressInstall.swf'; 
     58    HTML5.Audio.Proxy.prototype.className   = 'HTML5_Audio'; 
    5959 
    60         // singleton 
     60    // singleton 
    6161 
    62         HTML5.Audio.Proxy._instance; 
    63         HTML5.Audio.Proxy.getProxy = function (param) { 
    64             var proxy = HTML5.Audio.Proxy._instance; 
    65             if ( ! proxy ) { 
    66                 proxy = new HTML5.Audio.Proxy(); 
    67                 proxy.init(param); 
    68                 HTML5.Audio.Proxy._instance = proxy; 
    69             } 
    70             return proxy; 
    71         } 
     62    HTML5.Audio.Proxy._instance; 
     63    HTML5.Audio.Proxy.getProxy = function (param) { 
     64        var proxy = HTML5.Audio.Proxy._instance; 
     65        if ( ! proxy ) { 
     66            proxy = new HTML5.Audio.Proxy(); 
     67            proxy.init(param); 
     68            HTML5.Audio.Proxy._instance = proxy; 
     69        } 
     70        return proxy; 
     71    } 
    7272} 
  • lang/javascript/HTML5.Audio/trunk/js/jkl-js2as.js

    r33379 r33383  
    2626 */ 
    2727 
    28 //      global 
     28//  global 
    2929 
    3030if ( ! window.JKL ) JKL = {}; 
     
    3333 
    3434if ( ! JKL.Console ) { 
    35         JKL.Console = window.console; 
    36         if ( ! JKL.Console ) JKL.Console = {}; 
    37         if ( ! JKL.Console.log )  JKL.Console.log   = function () {}; 
    38         if ( ! JKL.Console.info ) JKL.Console.info  = function () {}; 
    39         if ( ! JKL.Console.warn ) JKL.Console.warn  = function () {}; 
    40         if ( ! JKL.Console.error ) { 
    41                 JKL.Console.error = function (mess) { 
    42                         alert( 'Error: '+mess ); 
    43                 }; 
    44         } 
     35    JKL.Console = window.console; 
     36    if ( ! JKL.Console ) JKL.Console = {}; 
     37    if ( ! JKL.Console.log )  JKL.Console.log   = function () {}; 
     38    if ( ! JKL.Console.info ) JKL.Console.info  = function () {}; 
     39    if ( ! JKL.Console.warn ) JKL.Console.warn  = function () {}; 
     40    if ( ! JKL.Console.error ) { 
     41        JKL.Console.error = function (mess) { 
     42            alert( 'Error: '+mess ); 
     43        }; 
     44    } 
    4545} 
    4646 
     
    4848 
    4949if ( ! JKL.Util ) { 
    50         JKL.Util = function () {}; 
    51         JKL.Util.prefix = '_jkl_util_'; 
    52         JKL.Util._callbackId = 1; 
    53         JKL.Util.prototype.getCallback = function ( func ) { 
    54                 if ( ! func ) return; 
    55                 if ( typeof(func) == 'string' ) return func; 
    56                 var id = JKL.Util._callbackId ++; 
    57                 var name = JKL.Util.prefix + id; 
    58                 var that = this; 
    59                 window[name] = function () { 
    60                         func.apply( null, arguments ); 
    61                 }; 
    62                 return name; 
    63         }; 
     50    JKL.Util = function () {}; 
     51    JKL.Util.prefix = '_jkl_util_'; 
     52    JKL.Util._callbackId = 1; 
     53    JKL.Util.prototype.getCallback = function ( func ) { 
     54        if ( ! func ) return; 
     55        if ( typeof(func) == 'string' ) return func; 
     56        var id = JKL.Util._callbackId ++; 
     57        var name = JKL.Util.prefix + id; 
     58        var that = this; 
     59        window[name] = function () { 
     60            func.apply( null, arguments ); 
     61        }; 
     62        return name; 
     63    }; 
    6464} 
    6565 
     
    6767 
    6868if ( ! JKL.Job ) { 
    69         JKL.Job = function ( func, onfinish, onerror ) { 
    70             if ( ! func ) return window.undefined; 
    71             JKL.Job.Instances ++; 
    72             this.id       = JKL.Job.Instances; 
    73             this.func     = func; 
    74             this.onfinish = onfinish; 
    75             this.onerror  = onerror; 
    76             this.done     = false; 
    77             this.tried    = 0; 
    78         }; 
    79         JKL.Job.Instances = 0; 
    80         JKL.Job.prototype = new JKL.Util(); 
    81         JKL.Job.prototype.maxRetry  = 10; 
    82         JKL.Job.prototype.interval  =  1; 
    83         JKL.Job.prototype.run = function () { 
    84             var ret = this.func(); 
    85             this.tried ++; 
    86             if ( ret ) { 
    87                 this.done = true; 
    88                 if ( this.onfinish ) { 
    89                     this.onfinish( ret ); 
    90                 } 
    91             } else if ( this.tried < this.maxRetry ) { 
    92                 var that = this; 
    93                 var next = function () { 
    94                     that.run(); 
    95                 }; 
    96                         this.interval *= 2; 
    97                 window.setTimeout( next, this.interval ); 
    98             } else { 
    99                 if ( this.onerror ) { 
    100                     this.onerror( "too many retries: "+this.tried ); 
    101                 } 
    102             } 
    103         } 
     69    JKL.Job = function ( func, onfinish, onerror ) { 
     70        if ( ! func ) return window.undefined; 
     71        JKL.Job.Instances ++; 
     72        this.id       = JKL.Job.Instances; 
     73        this.func     = func; 
     74        this.onfinish = onfinish; 
     75        this.onerror  = onerror; 
     76        this.done     = false; 
     77        this.tried    = 0; 
     78    }; 
     79    JKL.Job.Instances = 0; 
     80    JKL.Job.prototype = new JKL.Util(); 
     81    JKL.Job.prototype.maxRetry  = 10; 
     82    JKL.Job.prototype.interval  =  1; 
     83    JKL.Job.prototype.run = function () { 
     84        var ret = this.func(); 
     85        this.tried ++; 
     86        if ( ret ) { 
     87            this.done = true; 
     88            if ( this.onfinish ) { 
     89                this.onfinish( ret ); 
     90            } 
     91        } else if ( this.tried < this.maxRetry ) { 
     92            var that = this; 
     93            var next = function () { 
     94                that.run(); 
     95            }; 
     96            this.interval *= 2; 
     97            window.setTimeout( next, this.interval ); 
     98        } else { 
     99            if ( this.onerror ) { 
     100                this.onerror( "too many retries: "+this.tried ); 
     101            } 
     102        } 
     103    } 
    104104} 
    105105 
     
    107107 
    108108if ( ! JKL.JS2AS ) { 
    109         JKL.JS2AS = function () { 
    110             JKL.JS2AS.Instances ++; 
    111             this.id = JKL.JS2AS.Instances; 
    112             this._swfName = this.prefix + this.id; 
    113                 this.flashVars = {}; 
    114                 this.flashParams = new JKL.JS2AS.FlashParams(); 
    115                 this.flashAttributes = {}; 
    116             return this; 
    117         }; 
    118         JKL.JS2AS.Instances = 0; 
    119         JKL.JS2AS.prototype = new JKL.Util(); 
    120  
    121         JKL.JS2AS.prototype.prefix  = '_jkl_js2as_'; 
    122         JKL.JS2AS.prototype.id; 
    123         JKL.JS2AS.prototype._swfName; 
    124         JKL.JS2AS.prototype.swfPath     = null; 
    125         JKL.JS2AS.prototype.installPath = null; 
    126         JKL.JS2AS.prototype.noCache     = false; 
    127         JKL.JS2AS.prototype.displayX    = 1; 
    128         JKL.JS2AS.prototype.displayY    = 1; 
    129         JKL.JS2AS.prototype.flashVersion = '9.0.0'; 
    130         JKL.JS2AS.prototype.flashVars; 
    131         JKL.JS2AS.prototype.flashParams; 
    132         JKL.JS2AS.prototype.flashAttributes; 
    133  
    134         JKL.JS2AS.prototype.init = function (param) { 
    135                 if ( param ) { 
    136                         for( var key in param ) { 
    137                                 this[key] = param[key]; 
    138                         } 
    139                 } 
    140             var that = this; 
    141             var func = function () { 
    142                 return that.doInit(); 
    143             }; 
    144             var job = new JKL.Job( func ); 
    145             job.run(); 
    146  
    147         } 
    148         JKL.JS2AS.prototype.doInit = function () { 
    149             if ( ! document.body ) return false; 
    150             if ( ! window.swfobject ) return false; 
    151  
    152                 // .swf file URL 
    153             var swfPath   = this.swfPath; 
    154             var instPath  = this.installPath; 
    155             if ( this.noCache ) { 
    156                 swfPath  += '?'+Math.floor(Math.random()*900000+100000); 
    157                 instPath += '?'+Math.floor(Math.random()*900000+100000); 
    158             } 
    159  
    160             // create object element for flash 
    161             var dummyElem = document.createElement( 'span' );   // dummy 
    162             dummyElem.id = this._swfName; 
    163             document.body.appendChild( dummyElem ); 
    164  
    165                 // load flash 
    166             swfobject.embedSWF(swfPath, this._swfName, this.displayX, this.displayY, 
    167                 this.flashVersion, instPath, this.flashVars, 
    168                         this.flashParams, this.flashAttributes);   
    169  
    170                 // wait until flash is loaded 
    171             var that = this; 
    172             var func = function () { 
    173                 return that.waitReady(); 
    174             }; 
    175             var job = new JKL.Job( func ); 
    176             job.run(); 
    177  
    178             return true; 
    179         } 
    180  
    181         JKL.JS2AS.prototype.waitReady = function () { 
    182             var swf = this.getSwfObject(); 
    183             if ( ! swf ) return false; 
    184             if ( ! swf.create ) return false; 
    185  
    186                 // onready callback 
    187                 if ( this.onready ) { 
    188                         this.onready( this ); 
    189                 } 
    190  
    191             return true; 
    192         } 
    193  
    194         JKL.JS2AS.prototype._swfObject; 
    195         JKL.JS2AS.prototype.getSwfObject = function () { 
    196             if ( this._swfObject ) return this._swfObject; 
    197             if (navigator.appName.indexOf("Microsoft") != -1) { 
    198                 this._swfObject = window[this._swfName] 
    199             } else { 
    200                 this._swfObject = document[this._swfName] 
    201             } 
    202             return this._swfObject; 
    203         } 
    204 } 
    205  
    206 //      flash parameters 
     109    JKL.JS2AS = function () { 
     110        JKL.JS2AS.Instances ++; 
     111        this.id = JKL.JS2AS.Instances; 
     112        this._swfName = this.prefix + this.id; 
     113        this.flashVars = {}; 
     114        this.flashParams = new JKL.JS2AS.FlashParams(); 
     115        this.flashAttributes = {}; 
     116        return this; 
     117    }; 
     118    JKL.JS2AS.Instances = 0; 
     119    JKL.JS2AS.prototype = new JKL.Util(); 
     120 
     121    JKL.JS2AS.prototype.prefix  = '_jkl_js2as_'; 
     122    JKL.JS2AS.prototype.id; 
     123    JKL.JS2AS.prototype._swfName; 
     124    JKL.JS2AS.prototype.swfPath     = null; 
     125    JKL.JS2AS.prototype.installPath = null; 
     126    JKL.JS2AS.prototype.noCache     = false; 
     127    JKL.JS2AS.prototype.displayX    = 1; 
     128    JKL.JS2AS.prototype.displayY    = 1; 
     129    JKL.JS2AS.prototype.flashVersion = '9.0.0'; 
     130    JKL.JS2AS.prototype.flashVars; 
     131    JKL.JS2AS.prototype.flashParams; 
     132    JKL.JS2AS.prototype.flashAttributes; 
     133 
     134    JKL.JS2AS.prototype.init = function (param) { 
     135        if ( param ) { 
     136            for( var key in param ) { 
     137                this[key] = param[key]; 
     138            } 
     139        } 
     140        var that = this; 
     141        var func = function () { 
     142            return that.doInit(); 
     143        }; 
     144        var job = new JKL.Job( func ); 
     145        job.run(); 
     146 
     147    } 
     148    JKL.JS2AS.prototype.doInit = function () { 
     149        if ( ! document.body ) return false; 
     150        if ( ! window.swfobject ) return false; 
     151 
     152        // .swf file URL 
     153        var swfPath   = this.swfPath; 
     154        var instPath  = this.installPath; 
     155        if ( this.noCache ) { 
     156            swfPath  += '?'+Math.floor(Math.random()*900000+100000); 
     157            instPath += '?'+Math.floor(Math.random()*900000+100000); 
     158        } 
     159 
     160        // create object element for flash 
     161        var dummyElem = document.createElement( 'span' );   // dummy 
     162        dummyElem.id = this._swfName; 
     163        document.body.appendChild( dummyElem ); 
     164 
     165        // load flash 
     166        swfobject.embedSWF(swfPath, this._swfName, this.displayX, this.displayY, 
     167            this.flashVersion, instPath, this.flashVars, 
     168            this.flashParams, this.flashAttributes);   
     169 
     170        // wait until flash is loaded 
     171        var that = this; 
     172        var func = function () { 
     173            return that.waitReady(); 
     174        }; 
     175        var job = new JKL.Job( func ); 
     176        job.run(); 
     177 
     178        return true; 
     179    } 
     180 
     181    JKL.JS2AS.prototype.waitReady = function () { 
     182        var swf = this.getSwfObject(); 
     183        if ( ! swf ) return false; 
     184        if ( ! swf.create ) return false; 
     185 
     186        // onready callback 
     187        if ( this.onready ) { 
     188            this.onready( this ); 
     189        } 
     190 
     191        return true; 
     192    } 
     193 
     194    JKL.JS2AS.prototype._swfObject; 
     195    JKL.JS2AS.prototype.getSwfObject = function () { 
     196        if ( this._swfObject ) return this._swfObject; 
     197        if (navigator.appName.indexOf("Microsoft") != -1) { 
     198            this._swfObject = window[this._swfName] 
     199        } else { 
     200            this._swfObject = document[this._swfName] 
     201        } 
     202        return this._swfObject; 
     203    } 
     204} 
     205 
     206//  flash parameters 
    207207 
    208208if ( ! JKL.JS2AS.FlashParams ) { 
    209         JKL.JS2AS.FlashParams = function () {}; 
    210         JKL.JS2AS.FlashParams.prototype.wmode           = 'transparent'; 
    211         JKL.JS2AS.FlashParams.prototype.quality         = 'low'; 
    212         JKL.JS2AS.FlashParams.prototype.scale           = 'noScale'; 
    213         JKL.JS2AS.FlashParams.prototype.salign          = 'lt'; 
    214         JKL.JS2AS.FlashParams.prototype.menu            = 'false'; 
    215         JKL.JS2AS.FlashParams.prototype.allowfullscreen = 'false'; 
     209    JKL.JS2AS.FlashParams = function () {}; 
     210    JKL.JS2AS.FlashParams.prototype.wmode           = 'transparent'; 
     211    JKL.JS2AS.FlashParams.prototype.quality         = 'low'; 
     212    JKL.JS2AS.FlashParams.prototype.scale           = 'noScale'; 
     213    JKL.JS2AS.FlashParams.prototype.salign          = 'lt'; 
     214    JKL.JS2AS.FlashParams.prototype.menu            = 'false'; 
     215    JKL.JS2AS.FlashParams.prototype.allowfullscreen = 'false'; 
    216216} 
    217217 
     
    219219 
    220220if ( ! JKL.JS2AS.Item ) { 
    221         JKL.JS2AS.Item = function () {} 
    222         JKL.JS2AS.Item.prototype = new JKL.Util(); 
    223         JKL.JS2AS.Item.prototype.className = null; 
    224         JKL.JS2AS.Item.prototype.create = function () { 
    225                 var args = []; 
    226                 args.push.apply( args, arguments ); 
    227  
    228             var cls = this.proxy.className; 
    229             args.unshift( cls );                // 1st argument 
    230  
    231             var swf = this.proxy.getSwfObject(); 
    232  
    233             if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
    234             if ( ! swf.create ) return JKL.Console.error( 'create interface not found: '+this.swfPath ); 
    235             if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
    236  
    237                 this.id = swf.create.apply( swf, args ); 
    238         } 
    239  
    240         JKL.JS2AS.Item.prototype.call = function () { 
    241                 var args = []; 
    242                 args.push.apply( args, arguments ); 
    243             args.unshift( this.id );            // 1st argument 
    244  
    245             var swf = this.proxy.getSwfObject(); 
    246                 var cls = this.proxy.className; 
    247             if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
    248             if ( ! swf.call ) return JKL.Console.error( 'call interface not found: '+this.swfPath ); 
    249             if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
    250  
    251             return swf.call.apply( swf, args ); 
    252         } 
    253  
    254         JKL.JS2AS.Item.prototype.set = function ( key, val ) { 
    255             var swf = this.proxy.getSwfObject(); 
    256                 var cls = this.proxy.className; 
    257             if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
    258             if ( ! swf.setter ) return JKL.Console.error( 'setter interface not found: '+this.swfPath ); 
    259             if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
    260  
    261                 if ( typeof(val) == 'function' ) { 
    262                         val = this.getCallback( val ); 
    263                 } 
    264  
    265             return swf.setter( this.id, key, val ); 
    266         } 
    267  
    268         JKL.JS2AS.Item.prototype.get = function ( key ) { 
    269             var swf = this.proxy.getSwfObject(); 
    270                 var cls = this.proxy.className; 
    271             if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
    272             if ( ! swf.getter ) return JKL.Console.error( 'getter interface not found: '+this.swfPath ); 
    273             if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
    274  
    275             return swf.getter( this.id, key ); 
    276         } 
    277  
    278         JKL.JS2AS.Item.prototype.drop = function () { 
    279             var swf = this.proxy.getSwfObject(); 
    280                 var cls = this.proxy.className; 
    281             if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
    282             if ( ! swf.drop ) return JKL.Console.error( 'drop interface not found: '+this.swfPath ); 
    283             if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
    284  
    285             return swf.drop( this.id ); 
    286         } 
    287 } 
     221    JKL.JS2AS.Item = function () {} 
     222    JKL.JS2AS.Item.prototype = new JKL.Util(); 
     223    JKL.JS2AS.Item.prototype.className = null; 
     224    JKL.JS2AS.Item.prototype.create = function () { 
     225        var args = []; 
     226        args.push.apply( args, arguments ); 
     227 
     228        var cls = this.proxy.className; 
     229        args.unshift( cls );                // 1st argument 
     230 
     231        var swf = this.proxy.getSwfObject(); 
     232 
     233        if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
     234        if ( ! swf.create ) return JKL.Console.error( 'create interface not found: '+this.swfPath ); 
     235        if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
     236 
     237        this.id = swf.create.apply( swf, args ); 
     238    } 
     239 
     240    JKL.JS2AS.Item.prototype.call = function () { 
     241        var args = []; 
     242        args.push.apply( args, arguments ); 
     243        args.unshift( this.id );            // 1st argument 
     244 
     245        var swf = this.proxy.getSwfObject(); 
     246        var cls = this.proxy.className; 
     247        if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
     248        if ( ! swf.call ) return JKL.Console.error( 'call interface not found: '+this.swfPath ); 
     249        if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
     250 
     251        return swf.call.apply( swf, args ); 
     252    } 
     253 
     254    JKL.JS2AS.Item.prototype.set = function ( key, val ) { 
     255        var swf = this.proxy.getSwfObject(); 
     256        var cls = this.proxy.className; 
     257        if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
     258        if ( ! swf.setter ) return JKL.Console.error( 'setter interface not found: '+this.swfPath ); 
     259        if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
     260 
     261        if ( typeof(val) == 'function' ) { 
     262            val = this.getCallback( val ); 
     263        } 
     264 
     265        return swf.setter( this.id, key, val ); 
     266    } 
     267 
     268    JKL.JS2AS.Item.prototype.get = function ( key ) { 
     269        var swf = this.proxy.getSwfObject(); 
     270        var cls = this.proxy.className; 
     271        if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
     272        if ( ! swf.getter ) return JKL.Console.error( 'getter interface not found: '+this.swfPath ); 
     273        if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
     274 
     275        return swf.getter( this.id, key ); 
     276    } 
     277 
     278    JKL.JS2AS.Item.prototype.drop = function () { 
     279        var swf = this.proxy.getSwfObject(); 
     280        var cls = this.proxy.className; 
     281        if ( ! swf ) return JKL.Console.error( 'swf not ready: '+this.swfPath ); 
     282        if ( ! swf.drop ) return JKL.Console.error( 'drop interface not found: '+this.swfPath ); 
     283        if ( ! cls ) return JKL.Console.error( 'invalid calss name: '+cls ); 
     284 
     285        return swf.drop( this.id ); 
     286    } 
     287}