Ignore:
Timestamp:
06/05/08 11:54:24 (5 years ago)
Author:
jeroen
Message:

fixes in skinning and controlbar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/as3/com/jeroenwijering/views/ControlbarView.as

    r1 r2  
    6464        private function captionHandler(evt:ControllerEvent) { 
    6565                if(evt.data.state == true) {  
    66                         bar.captionButton.icn.visible = true; 
    67                         bar.captionButton.alt.visible = false; 
     66                        try { 
     67                                bar.captionButton.icn.visible = true; 
     68                                bar.captionButton.alt.visible = false; 
     69                        } catch (err:Error) {} 
    6870                } else { 
    69                         bar.captionButton.icn.visible = false; 
    70                         bar.captionButton.alt.visible = true; 
     71                        try { 
     72                                bar.captionButton.icn.visible = false; 
     73                                bar.captionButton.alt.visible = true; 
     74                        } catch (err:Error) {} 
    7175                } 
    7276        }; 
     
    160164                        pc2 = evt.data.offset/evt.data.total; 
    161165                } 
    162                 var wid = bar.timeSlider.bck.width; 
    163                 bar.timeSlider.bar.x = Math.round(pc2*wid); 
    164                 bar.timeSlider.bar.width = Math.round(pc1*wid);   
     166                try { 
     167                        var wid = bar.timeSlider.bck.width; 
     168                        bar.timeSlider.bar.x = Math.round(pc2*wid); 
     169                        bar.timeSlider.bar.width = Math.round(pc1*wid);   
     170                } catch (err:Error) {} 
    165171        }; 
    166172 
     
    208214                        if(evt.data.width > 640) {  
    209215                                bar.x = Math.round(evt.data.width/2 - 300); 
    210                                 bar.back.width = 600; 
     216                                try { bar.back.width = 600; } catch (err:Error) {} 
    211217                        } else {  
    212218                                bar.x = view.config['controlbarsize']; 
    213                                 bar.back.width = evt.data.width - view.config['controlbarsize']*2; 
     219                                try { bar.back.width = evt.data.width - view.config['controlbarsize']*2;  } catch (err:Error) {} 
    214220                        } 
    215221                } else { 
    216222                        bar.x = 0; 
    217                         bar.back.width = evt.data.width; 
     223                        try { bar.back.width = evt.data.width;  } catch (err:Error) {} 
    218224                        bar.y = evt.data.height; 
    219225                        if(view.config['playlist'] == 'right') {  
    220                                 bar.back.width += view.config['playlistsize']; 
    221                         } 
    222                 } 
    223                 if(evt.data.fullscreen == true) {  
    224                         bar.fullscreenButton.icn.visible = false; 
    225                         bar.fullscreenButton.alt.visible = true; 
    226                 } else {  
    227                         bar.fullscreenButton.icn.visible = true; 
    228                         bar.fullscreenButton.alt.visible = false; 
    229                 } 
     226                                try { bar.back.width += view.config['playlistsize'];  } catch (err:Error) {} 
     227                        } 
     228                } 
     229                try {  
     230                        if(evt.data.fullscreen == true) {  
     231                                bar.fullscreenButton.icn.visible = false; 
     232                                bar.fullscreenButton.alt.visible = true; 
     233                        } else {  
     234                                bar.fullscreenButton.icn.visible = true; 
     235                                bar.fullscreenButton.alt.visible = false; 
     236                        } 
     237                } catch (err:Error) {} 
    230238                setButtons(); 
    231239        }; 
     
    317325                } catch(err:Error) {} 
    318326                var pct = evt.data.position/evt.data.duration; 
    319                 var xps = Math.floor(pct*bar.timeSlider.bck.width); 
    320                 if (dur <= 0) { 
    321                         bar.timeSlider.icn.visible = false; 
    322                 } else { 
    323                         bar.timeSlider.icn.visible = true; 
    324                         bar.timeSlider.icn.x = xps; 
    325                 } 
     327                try { 
     328                        var xps = Math.floor(pct*bar.timeSlider.bck.width); 
     329                        if (dur <= 0) { 
     330                                bar.timeSlider.icn.visible = false; 
     331                        } else { 
     332                                bar.timeSlider.icn.visible = true; 
     333                                bar.timeSlider.icn.x = xps; 
     334                        } 
     335                } catch(err:Error) {} 
    326336        }; 
    327337 
Note: See TracChangeset for help on using the changeset viewer.