Ignore:
Timestamp:
10/01/08 09:07:36 (5 years ago)
Author:
jeroen
Message:

air version is working, string of fixes to 4.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/com/jeroenwijering/player/SWFLoader.as

    r68 r75  
    2424        /** Base directory for the plugins. **/ 
    2525        private var basedir:String = 'http://plugins.longtailvideo.com/'; 
     26        /** Number of plugns that are done loading. **/ 
     27        private var done:Number; 
    2628 
    2729 
     
    4345        public function loadPlugins(pgi:String=null):void { 
    4446                if(pgi) { 
    45                         var arr = pgi.split(','); 
    46                         for(var i in arr) { loadSWF(arr[i],false); } 
     47                        var arr:Array = pgi.split(','); 
     48                        done = arr.length; 
     49                        for(var i:Number=0; i<arr.length; i++) { 
     50                                loadSWF(arr[i],false); 
     51                        } 
     52                } else { 
     53                        dispatchEvent(new Event(Event.COMPLETE)); 
    4754                } 
    48         };  
     55        }; 
    4956 
    5057 
     
    5865                        loadSWF(skn,true); 
    5966                } else { 
    60                         dispatchEvent(new Event(Event.COMPLETE)); 
     67                        dispatchEvent(new Event(Event.INIT)); 
    6168                } 
    6269        }; 
     
    95102        private function pluginError(evt:IOErrorEvent):void { 
    96103                player.view.sendEvent('TRACE',' plugin: '+evt.text); 
     104                done--; 
     105                if(done == 0) { 
     106                        dispatchEvent(new Event(Event.COMPLETE)); 
     107                } 
    97108        }; 
    98109 
     
    106117                        player.view.sendEvent('TRACE',' plugin: '+err.message); 
    107118                } 
     119                done--; 
     120                if(done == 0) { 
     121                        dispatchEvent(new Event(Event.COMPLETE)); 
     122                } 
    108123        }; 
    109124 
     
    112127        private function skinError(evt:IOErrorEvent=null):void { 
    113128                player.skin = player['player']; 
    114                 dispatchEvent(new Event(Event.COMPLETE)); 
     129                dispatchEvent(new Event(Event.INIT)); 
    115130        }; 
    116131 
     
    120135                var clp = evt.target.content; 
    121136                if(clp['player']) { 
    122                         player.skin = MovieClip(clp['player']); 
     137                        player.skin = clp['player'] as MovieClip; 
    123138                        Draw.clear(player); 
    124139                        player.addChild(player.skin); 
    125                         dispatchEvent(new Event(Event.COMPLETE)); 
     140                        dispatchEvent(new Event(Event.INIT)); 
    126141                } else { 
    127142                        skinError(); 
Note: See TracChangeset for help on using the changeset viewer.