Changeset 57


Ignore:
Timestamp:
08/12/08 05:04:55 (5 years ago)
Author:
jeroen
Message:

added 3.17 rotator and :void returns to as3 functions

Files:
7 added
1 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/as2/com/jeroenwijering/players/AbstractView.as

    r1 r57  
    8585        /** Send event to the controller. **/ 
    8686        private function sendEvent(typ:String,prm:Number) { 
    87                 controller.getEvent(typ,prm);  
     87                controller.getEvent(typ,prm); 
    8888        }; 
    8989 
  • trunk/as2/com/jeroenwijering/players/FLVModel.as

    r1 r57  
    9494                if(pos < 1) { 
    9595                        pos = 0;  
    96                 } else if (pos > feeder.feed[currentItem]["duration"] - 1) {  
    97                         pos = feeder.feed[currentItem]["duration"] - 1;  
     96                } else if (pos > feeder.feed[currentItem]["duration"]-1) { 
     97                        pos = feeder.feed[currentItem]["duration"]-1;  
    9898                } 
    9999                if (flvType=="RTMP" && feeder.feed[currentItem]["id"] != currentURL) { 
     
    201201        /** Pause the video that's currently playing. **/ 
    202202        private function setPause(pos:Number) { 
    203                 if(pos < 1) { pos = 0; } 
     203                if(pos < 1) { 
     204                        pos = 0;  
     205                } else if (pos > feeder.feed[currentItem]["duration"]-1) { 
     206                        pos = feeder.feed[currentItem]["duration"]-1;  
     207                } 
    204208                clearInterval(positionInterval); 
    205209                if(pos != undefined) { 
  • trunk/as2/com/jeroenwijering/players/ImageRotator.as

    r1 r57  
    1010 
    1111 
    12 class com.jeroenwijering.players.ImageRotator extends AbstractPlayer {  
     12class com.jeroenwijering.players.ImageRotator extends AbstractPlayer { 
    1313 
    1414 
     
    4343                rotatetime:5, 
    4444                shuffle:"true", 
     45                usefullscreen:'true', 
    4546                volume:80, 
    4647 
     
    5152                useaudio:"true", 
    5253 
    53                 abouttxt:"JW Image Rotator 3.16", 
     54                abouttxt:"JW Image Rotator 3.17", 
    5455                aboutlnk:"http://www.jeroenwijering.com/?about=JW_Image_Rotator" 
    5556        }; 
  • trunk/as2/com/jeroenwijering/players/JavascriptView.as

    r1 r57  
    3636                super(ctr,cfg,fed); 
    3737                if(ExternalInterface.available) { 
    38                         ExternalInterface.addCallback("sendEvent",this,sendEvent); 
     38                        try {  
     39                                ExternalInterface.addCallback("sendEvent",this,sendEvent); 
     40                        } catch(err) {} 
    3941                } 
    4042        }; 
  • trunk/as2/com/jeroenwijering/players/MediaPlayer.as

    r1 r57  
    2222                displayheight:undefined, 
    2323                displaywidth:undefined, 
    24                 searchbar:'true', 
     24                searchbar:'false', 
    2525 
    2626                file:undefined, 
     
    7878                usekeys:'true', 
    7979 
    80                 abouttxt:'JW Player 3.16', 
     80                abouttxt:'JW Player 3.17', 
    8181                aboutlnk:'http://www.jeroenwijering.com/?about=JW_FLV_Media_Player' 
    8282        }; 
  • trunk/as2/com/jeroenwijering/players/PlayerController.as

    r1 r57  
    5353                } 
    5454                if(config["autostart"] == "false") { 
     55                        isPlaying = false; 
    5556                        sendChange("pause",feeder.feed[currentItem]['start']); 
    56                         isPlaying = false; 
    5757                } else { 
    5858                        sendChange("start",feeder.feed[currentItem]['start']); 
  • trunk/as2/com/jeroenwijering/players/RotatorController.as

    r1 r57  
    105105        /** Play a new item. **/ 
    106106        private function setPlayitem(itm:Number) { 
    107                 if(itm != currentItem) { 
    108                         sendChange("stop"); 
    109                         itm > feeder.feed.length-1 ? itm = feeder.feed.length-1: null; 
    110                         currentItem = itm; 
    111                         sendChange("item",itm); 
    112                 } 
     107                sendChange("stop"); 
     108                itm > feeder.feed.length-1 ? itm = feeder.feed.length-1: null; 
     109                currentItem = itm; 
     110                sendChange("item",itm); 
    113111                if(feeder.feed[itm]["start"] == undefined) { 
    114112                        sendChange("start",0); 
     
    132130 
    133131        /** Determine what to do if an item is completed. **/ 
    134         private function setComplete() {  
     132        private function setComplete() { 
    135133                itemsPlayed++; 
    136134                if(config["repeat"]=="false" || (config["repeat"] == "list" 
    137                         && itemsPlayed >= feeder.feed.length)) { 
     135                        && currentItem == feeder.feed.length-1)) { 
    138136                        sendChange("pause",0); 
    139137                        isPlaying = false; 
     
    169167 
    170168 
     169        /** Fullscreen switch function. **/ 
     170        private function setFullscreen() { 
     171                if(Stage["displayState"] == "normal" && config["usefullscreen"] == "true") { 
     172                        Stage["displayState"] = "fullScreen"; 
     173                } else if (Stage["displayState"] == "fullScreen" &&  
     174                        config["usefullscreen"] == "true") { 
     175                        Stage["displayState"] = "normal"; 
     176                } 
     177        }; 
     178 
     179 
    171180        /** Switch active model and send changes. **/ 
    172181        private function sendChange(typ:String,prm:Number):Void { 
  • trunk/as2/com/jeroenwijering/players/RotatorView.as

    r1 r57  
    4242                "slowfade" 
    4343        ); 
     44        /** Dimensions of the display **/ 
     45        private var dims:Array; 
    4446 
    4547 
     
    4749        function RotatorView(ctr:AbstractController,cfg:Object,fed:Object) {  
    4850                super(ctr,cfg,fed); 
     51                dims = new Array(config['width'],config['height']); 
    4952                setColorsClicks(); 
    5053                if(config["shownavigation"] == "true") { 
    5154                        Mouse.addListener(this); 
     55                        Stage.addListener(this); 
    5256                } 
    5357        }; 
     
    5862                var ref = this; 
    5963                var tgt:MovieClip = config["clip"]; 
    60                 tgt.button._width = config["width"]; 
    61                 tgt.button._height = config["height"]; 
     64                tgt.button._width = dims[0]; 
     65                tgt.button._height = dims[1]; 
    6266                if(config['overstretch']=='true' || config['overstretch']=='fit') { 
    6367                        tgt.img1.bg._visible = tgt.img2.bg._visible = false; 
    6468                } else { 
    65                         tgt.img1.bg._width = tgt.img2.bg._width = config["width"]; 
    66                         tgt.img1.bg._height = tgt.img2.bg._height = config["height"]; 
     69                        tgt.img1.bg._width = tgt.img2.bg._width = dims[0]; 
     70                        tgt.img1.bg._height = tgt.img2.bg._height = dims[1]; 
    6771                        tgt.img1.col = new Color(tgt.img1.bg); 
    6872                        tgt.img1.col.setRGB(config["screencolor"]); 
     
    8690                tgt.navigation.swapDepths(6); 
    8791                tgt.logo.swapDepths(7); 
    88                 tgt.playicon._x=tgt.activity._x = Math.round(config["width"]/2); 
    89                 tgt.playicon._y=tgt.activity._y = Math.round(config["height"]/2); 
     92                tgt.playicon._x=tgt.activity._x = Math.round(dims[0]/2); 
     93                tgt.playicon._y=tgt.activity._y = Math.round(dims[1]/2); 
    9094                if(config["logo"] != undefined) { 
    9195                        var lll = new ImageLoader(tgt.logo,"none"); 
    9296                        lll.onLoadFinished = function() { 
    93                                 ref.config['clip'].logo._x = ref.config["displaywidth"] - 
     97                                ref.config['clip'].logo._x = ref.dims[0] - 
    9498                                        ref.config['clip'].logo._width -10; 
    9599                                ref.config['clip'].logo._y = 10; 
     
    99103                tgt = config["clip"].navigation; 
    100104                if (config["shownavigation"] == "true") { 
    101                         tgt._y = config["height"] - 40; 
    102                         tgt._x = config["width"]/2 - 50; 
     105                        tgt._y = dims[1] - 40; 
     106                        tgt._x = dims[0]/2 - 50; 
    103107                        tgt.prevBtn.col1 = new Color(tgt.prevBtn.bck); 
    104108                        tgt.prevBtn.col1.setRGB(config["backcolor"]); 
     
    199203                                tgt.audioBtn._x = 0; 
    200204                                tgt.audioBtn._visible = false; 
    201                         }        
    202                         tgt._x = Math.round(config["width"]/2 - tgt._width/2); 
     205                        } 
     206                         
     207                        if(Stage["displayState"] == "normal" && config["usefullscreen"] == "true") { 
     208                                tgt.fullscreenBtn.col1 = new Color(tgt.fullscreenBtn.bck); 
     209                                tgt.fullscreenBtn.col2 = new Color(tgt.fullscreenBtn.icnOn); 
     210                                tgt.fullscreenBtn.col3 = new Color(tgt.fullscreenBtn.icnOff); 
     211                                tgt.fullscreenBtn.col1.setRGB(config["backcolor"]); 
     212                                tgt.fullscreenBtn.col2.setRGB(config["frontcolor"]); 
     213                                tgt.fullscreenBtn.col3.setRGB(config["frontcolor"]); 
     214                                tgt.fullscreenBtn.onRollOver = function() { 
     215                                        this.col2.setRGB(ref.config["lightcolor"]); 
     216                                        this.col3.setRGB(ref.config["lightcolor"]); 
     217                                }; 
     218                                tgt.fullscreenBtn.onRollOut = function() { 
     219                                        this.col2.setRGB(ref.config["frontcolor"]); 
     220                                        this.col3.setRGB(ref.config["frontcolor"]); 
     221                                }; 
     222                                tgt.fullscreenBtn.onRelease = function() { 
     223                                        ref.sendEvent("fullscreen"); 
     224                                        this.col2.setRGB(ref.config["frontcolor"]); 
     225                                        this.col3.setRGB(ref.config["frontcolor"]); 
     226                                }; 
     227                                tgt.fullscreenBtn.icnOff._visible = false; 
     228                                if(feeder.audio == true) { 
     229                                        tgt.fullscreenBtn._x = len*6 + 130; 
     230                                } else { 
     231                                        tgt.fullscreenBtn._x = len*6 + 104; 
     232                                } 
     233                        } else { 
     234                                tgt.fullscreenBtn._x = 0; 
     235                                tgt.fullscreenBtn._visible = false; 
     236                        } 
     237                        tgt._x = Math.round(dims[0]/2 - tgt._width/2); 
    203238                } else { 
    204239                        tgt._visible = false; 
     
    268303                        clp._y = 0; 
    269304                } else if (dir == 2) { 
    270                         clp._x = config['width'] - upClip._width; 
    271                 } else { 
    272                         clp._y = config['height'] - upClip._height; 
     305                        clp._x = dims[0] - upClip._width; 
     306                } else { 
     307                        clp._y = dims[1] - upClip._height; 
    273308                } 
    274309                clp.onEnterFrame = function() { 
     
    372407                config["clip"].attachMovie("blocksMask","mask",3); 
    373408                var msk:MovieClip = config["clip"].mask; 
    374                 if (config["width"] > config["height"]) { 
    375                         msk._width = msk._height = config["width"]; 
    376                 } else { 
    377                         msk._width = msk._height = config["height"]; 
     409                if (dims[0] > dims[1]) { 
     410                        msk._width = msk._height = dims[0]; 
     411                } else { 
     412                        msk._width = msk._height = dims[1]; 
    378413                } 
    379414                msk._rotation = random(4)*90; 
    380                 msk._rotation == 90 ? msk._x = config["width"]: null; 
    381                 msk._rotation == 180 ? msk._x = config["width"]: null; 
    382                 msk._rotation == 180 ? msk._y = config["height"]: null; 
    383                 msk._rotation == -90 ? msk._y = config["height"]: null; 
     415                msk._rotation == 90 ? msk._x = dims[0]: null; 
     416                msk._rotation == 180 ? msk._x = dims[0]: null; 
     417                msk._rotation == 180 ? msk._y = dims[1]: null; 
     418                msk._rotation == -90 ? msk._y = dims[1]: null; 
    384419                upClip.setMask(msk); 
    385420                playClip(msk); 
     
    393428                var msk:MovieClip = config["clip"].mask; 
    394429                upClip.setMask(msk); 
    395                 if (config["width"] > config["height"]) { 
    396                         msk._width = msk._height = config["width"]; 
    397                         msk._y = config["height"]/2 - msk._height/2; 
    398                 } else { 
    399                         msk._width = msk._height = config["height"]; 
    400                         msk._x = config["width"]/2- msk._width/2; 
     430                if (dims[0] > dims[1]) { 
     431                        msk._width = msk._height = dims[0]; 
     432                        msk._y = dims[1]/2 - msk._height/2; 
     433                } else { 
     434                        msk._width = msk._height = dims[1]; 
     435                        msk._x = dims[0]/2- msk._width/2; 
    401436                } 
    402437                if(random(2) == 1) {  
    403438                        msk._xscale = -msk._xscale;  
    404                         msk._x += config['width'];  
     439                        msk._x += dims[0];  
    405440                } 
    406441                playClip(msk); 
     
    414449                var msk:MovieClip = config["clip"].mask; 
    415450                upClip.setMask(msk); 
    416                 if (config["width"] > config["height"]) { 
    417                         msk._width = msk._height = config["width"]; 
    418                 } else { 
    419                         msk._width = msk._height = config["height"]; 
    420                 } 
    421                 msk._x = config["width"]/2; 
    422                 msk._y = config["height"]/2; 
     451                if (dims[0] > dims[1]) { 
     452                        msk._width = msk._height = dims[0]; 
     453                } else { 
     454                        msk._width = msk._height = dims[1]; 
     455                } 
     456                msk._x = dims[0]/2; 
     457                msk._y = dims[1]/2; 
    423458                playClip(msk,10); 
    424459        }; 
     
    451486                var msk:MovieClip = config["clip"].mask; 
    452487                upClip.setMask(msk); 
    453                 msk._width = config["width"]; 
    454                 msk._height = config["height"]; 
     488                msk._width = dims[0]; 
     489                msk._height = dims[1]; 
    455490                playClip(msk); 
    456491        }; 
     
    463498                var msk:MovieClip = config["clip"].mask; 
    464499                upClip.setMask(msk); 
    465                 msk._width = config["width"]; 
    466                 msk._height = config["height"]; 
     500                msk._width = dims[0]; 
     501                msk._height = dims[1]; 
    467502                playClip(msk); 
    468503        }; 
     
    516551 
    517552 
     553        /** Catches fullscreen escape  **/ 
     554        public function onFullScreen(fs:Boolean) { 
     555                if(fs == false) { 
     556                        dims = new Array(config['width'],config['height']); 
     557                } else { 
     558                        dims = new Array(Stage.width,Stage.height); 
     559                } 
     560                config["clip"].navigation.fullscreenBtn.icnOn._visible = !fs; 
     561                config["clip"].navigation.fullscreenBtn.icnOff._visible = fs; 
     562                setDimensions(); 
     563                sendEvent('playitem',currentItem); 
     564        }; 
     565 
     566        /** Resize after a fullscreen enter/leave **/ 
     567        private function setDimensions() { 
     568                var tgt:MovieClip = config["clip"]; 
     569                tgt.button._width = tgt.img1.bg._width = tgt.img2.bg._width = dims[0]; 
     570                tgt.button._height = tgt.img1.bg._height = tgt.img2.bg._height = dims[1]; 
     571                tgt.playicon._x = tgt.activity._x = Math.round(dims[0]/2); 
     572                tgt.playicon._y = tgt.activity._y = Math.round(dims[1]/2); 
     573                tgt.logo._x = dims[0] - tgt.logo._width -10; 
     574                if (config["shownavigation"] == "true") { 
     575                        tgt.navigation._y = dims[1] - 40; 
     576                        tgt.navigation._x = Math.round(dims[0]/2-tgt.navigation._width/2); 
     577                } 
     578        }; 
     579 
     580 
    518581} 
  • trunk/as2/com/jeroenwijering/utils/ImageLoader.as

    r1 r57  
    7777        /** Scale the image while maintaining aspectratio **/ 
    7878        private function scaleImage(tgt:MovieClip):Void { 
     79                if(Stage["displayState"] == "fullScreen") { 
     80                        var tgw = Stage.width; 
     81                        var tgh = Stage.height; 
     82                } else {  
     83                        var tgw = targetWidth; 
     84                        var tgh = targetHeight; 
     85                } 
    7986                targetClip._xscale = targetClip._yscale = 100; 
    8087                var tcf = tgt._currentframe; 
     
    8390                sourceHeight = tgt._height; 
    8491                sourceLength = tgt._totalframes/20; 
    85                 var xsr = targetWidth/sourceWidth; 
    86                 var ysr = targetHeight/sourceHeight; 
     92                var xsr = tgw/sourceWidth; 
     93                var ysr = tgh/sourceHeight; 
    8794                if (overStretch == "fit" || Math.abs(xsr-ysr) < 0.1) { 
    88                         tgt._width = targetWidth; 
    89                         tgt._height = targetHeight; 
     95                        tgt._width = tgw; 
     96                        tgt._height = tgh; 
    9097                } else if ((overStretch == "true" && xsr > ysr) ||  
    9198                        (overStretch == "false" && xsr < ysr)) {  
     
    97104                } 
    98105                if(targetWidth != undefined) { 
    99                         tgt._x = targetWidth/2 - tgt._width/2; 
    100                         tgt._y = targetHeight/2 - tgt._height/2; 
     106                        tgt._x = tgw/2 - tgt._width/2; 
     107                        tgt._y = tgh/2 - tgt._height/2; 
    101108                } 
    102109                tgt.gotoAndPlay(tcf); 
  • trunk/as3/com/jeroenwijering/events/AbstractView.as

    r13 r57  
    2323 
    2424        /**  Subscribers to the controller and model. **/ 
    25         public function addControllerListener(typ:String,fcn:Function) {}; 
    26         public function addModelListener(typ:String,fcn:Function) {}; 
    27         public function addViewListener(typ:String,fcn:Function) {}; 
     25        public function addControllerListener(typ:String,fcn:Function):void {}; 
     26        public function addModelListener(typ:String,fcn:Function):void {}; 
     27        public function addViewListener(typ:String,fcn:Function):void {}; 
    2828 
    2929 
    3030        /**  Dispatch events. **/ 
    31         public function sendEvent(typ:String,prm:Object=undefined) { }; 
     31        public function sendEvent(typ:String,prm:Object=undefined):void { }; 
    3232 
    3333 
  • trunk/as3/com/jeroenwijering/events/ControllerEvent.as

    r49 r57  
    3232        * @param dat    An object with all associated data. 
    3333        **/ 
    34         public function ControllerEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false) { 
     34        public function ControllerEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false):void { 
    3535                super(typ,bbl,ccb); 
    3636                _data = dat; 
  • trunk/as3/com/jeroenwijering/events/ModelEvent.as

    r1 r57  
    2828        * @param dat    An object with all associated data. 
    2929        **/ 
    30         public function ModelEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false) { 
     30        public function ModelEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false):void { 
    3131                super(typ,bbl,ccb); 
    3232                _data = dat; 
  • trunk/as3/com/jeroenwijering/events/PluginInterface.as

    r56 r57  
    1111 
    1212 
    13         function initializePlugin(vie:AbstractView); 
     13        function initializePlugin(vie:AbstractView):void; 
    1414 
    1515 
  • trunk/as3/com/jeroenwijering/events/ViewEvent.as

    r53 r57  
    3636        * @param dat    An object with all associated data. 
    3737        **/ 
    38         public function ViewEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false) { 
     38        public function ViewEvent(typ:String,dat:Object=undefined,bbl:Boolean=false,ccb:Boolean=false):void { 
    3939                super(typ, bbl, ccb); 
    4040                _data = dat; 
  • trunk/as3/com/jeroenwijering/models/CameraModel.as

    r49 r57  
    3636 
    3737 
    38         public function CameraModel(mod:Model) { 
     38        public function CameraModel(mod:Model):void { 
    3939                model = mod; 
    4040                try { 
     
    5454 
    5555        /** Catch security errors. **/ 
    56         private function errorHandler(evt:ErrorEvent) { 
     56        private function errorHandler(evt:ErrorEvent):void { 
    5757                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    5858        }; 
     
    6161 
    6262        /** Load the camera into the video **/ 
    63         public function load() { 
     63        public function load():void { 
    6464                position = model.playlist[model.config['item']]['start']; 
    6565                model.mediaHandler(video); 
     
    7373 
    7474        /** Pause playback. **/ 
    75         public function pause() { 
     75        public function pause():void { 
    7676                video.attachCamera(null); 
    7777                if(stream) {  
     
    8686 
    8787        /** Resume playback **/ 
    88         public function play() { 
     88        public function play():void { 
    8989                video.attachCamera(camera); 
    9090                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 
     
    9999 
    100100        /** Change the quality mode. **/ 
    101         public function quality(stt:Boolean) { 
     101        public function quality(stt:Boolean):void { 
    102102                if(stt == true) { 
    103103                        camera.setMode(480,360,25); 
     
    115115 
    116116        /** Seek the camera timeline. **/ 
    117         public function seek(pos:Number) { 
     117        public function seek(pos:Number):void { 
    118118                position = pos; 
    119119                clearInterval(interval); 
     
    123123 
    124124        /** Destroy the videocamera. **/ 
    125         public function stop() { 
     125        public function stop():void { 
    126126                position = 0; 
    127127                video.attachCamera(null); 
     
    132132 
    133133        /** Receive NetStream status updates. **/ 
    134         private function statusHandler(evt:NetStatusEvent) { 
     134        private function statusHandler(evt:NetStatusEvent):void { 
    135135                if(evt.info.code == "NetConnection.Connect.Success") { 
    136136                        stream = new NetStream(connection); 
     
    143143 
    144144        /** Interval function that countdowns the time. **/ 
    145         private function timeInterval() { 
     145        private function timeInterval():void { 
    146146                position = Math.round(position*10+1)/10; 
    147147                var dur = model.playlist[model.config['item']]['duration']; 
     
    158158 
    159159        /** Volume setting **/ 
    160         public function volume(pct:Number) {}; 
     160        public function volume(pct:Number):void {}; 
    161161 
    162162 
  • trunk/as3/com/jeroenwijering/models/HTTPModel.as

    r55 r57  
    4848 
    4949        /** Constructor; sets up the connection and display. **/ 
    50         public function HTTPModel(mod:Model) { 
     50        public function HTTPModel(mod:Model):void { 
    5151                model = mod; 
    5252                connection = new NetConnection(); 
     
    7272 
    7373        /** Catch security errors. **/ 
    74         private function errorHandler(evt:ErrorEvent) { 
     74        private function errorHandler(evt:ErrorEvent):void { 
    7575                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    7676        }; 
     
    9999 
    100100        /** Load content. **/ 
    101         public function load() { 
     101        public function load():void { 
    102102                if(stream.bytesLoaded != stream.bytesTotal) { 
    103103                        stream.close(); 
     
    132132 
    133133        /** Interval for the loading progress **/ 
    134         private function loadHandler() { 
     134        private function loadHandler():void { 
    135135                loaded = stream.bytesLoaded; 
    136136                var ttl = stream.bytesTotal; 
     
    143143 
    144144        /** Catch noncritical errors. **/ 
    145         private function metaHandler(evt:ErrorEvent) { 
     145        private function metaHandler(evt:ErrorEvent):void { 
    146146                model.sendEvent(ModelEvent.META,{error:evt.text}); 
    147147        }; 
     
    149149 
    150150        /** Get metadata information from netstream class. **/ 
    151         public function onData(dat:Object) { 
     151        public function onData(dat:Object):void { 
    152152                if(dat.type == 'metadata' && !h264) { 
    153153                        if(dat.width) { 
     
    181181 
    182182        /** Pause playback. **/ 
    183         public function pause() { 
     183        public function pause():void { 
    184184                clearInterval(timeinterval); 
    185185                stream.pause(); 
     
    189189 
    190190        /** Resume playing. **/ 
    191         public function play() { 
     191        public function play():void { 
    192192                stream.resume(); 
    193193                timeinterval = setInterval(timeHandler,100); 
     
    197197 
    198198        /** Change the smoothing mode. **/ 
    199         public function seek(pos:Number) { 
     199        public function seek(pos:Number):void { 
    200200                clearInterval(timeinterval); 
    201201                var off = getOffset(pos); 
     
    216216 
    217217        /** Change the smoothing mode. **/ 
    218         public function quality(qua:Boolean) { 
     218        public function quality(qua:Boolean):void { 
    219219                if(qua == true) {  
    220220                        video.smoothing = true; 
     
    228228 
    229229        /** Receive NetStream status updates. **/ 
    230         private function statusHandler(evt:NetStatusEvent) { 
     230        private function statusHandler(evt:NetStatusEvent):void { 
    231231                if(evt.info.code == "NetStream.Play.Stop") { 
    232232                        if(model.config['state'] != ModelStates.COMPLETED) {  
     
    245245 
    246246        /** Destroy the HTTP stream. **/ 
    247         public function stop() { 
     247        public function stop():void { 
    248248                clearInterval(loadinterval); 
    249249                clearInterval(timeinterval); 
     
    259259 
    260260        /** Interval for the position progress **/ 
    261         private function timeHandler() { 
     261        private function timeHandler():void { 
    262262                var bfr = Math.round(stream.bufferLength/stream.bufferTime*100); 
    263263                var pos = Math.round(stream.time*10)/10; 
     
    284284 
    285285        /** Set the volume level. **/ 
    286         public function volume(vol:Number) { 
     286        public function volume(vol:Number):void { 
    287287                transform.volume = vol/100; 
    288288                stream.soundTransform = transform; 
  • trunk/as3/com/jeroenwijering/models/ImageModel.as

    r53 r57  
    3131 
    3232        /** Constructor; sets up listeners **/ 
    33         public function ImageModel(mod:Model) { 
     33        public function ImageModel(mod:Model):void { 
    3434                model = mod; 
    3535                loader = new Loader(); 
     
    4141 
    4242        /** load image into screen **/ 
    43         public function load() { 
     43        public function load():void { 
    4444                clearInterval(interval); 
    4545                position = model.playlist[model.config['item']]['start']; 
     
    5151 
    5252        /** Catch errors. **/ 
    53         private function errorHandler(evt:ErrorEvent) { 
     53        private function errorHandler(evt:ErrorEvent):void { 
    5454                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    5555        }; 
     
    5757 
    5858        /** Load and place the image on stage. **/ 
    59         private function loaderHandler(evt:Event) { 
     59        private function loaderHandler(evt:Event):void { 
    6060                model.mediaHandler(loader); 
    6161                quality(model.config['quality']); 
     
    6767 
    6868        /** Resume playback of the images **/ 
    69         public function play() { 
     69        public function play():void { 
    7070                interval = setInterval(timeInterval,100); 
    7171                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PLAYING}); 
     
    7474 
    7575        /** Show or hide the camera. **/ 
    76         public function pause() { 
     76        public function pause():void { 
    7777                clearInterval(interval); 
    7878                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.PAUSED}); 
     
    8181 
    8282        /** Send load progress to player. **/ 
    83         private function progressHandler(evt:ProgressEvent) { 
     83        private function progressHandler(evt:ProgressEvent):void { 
    8484                var pct = Math.round(evt.bytesLoaded/evt.bytesTotal*100); 
    8585                model.sendEvent(ModelEvent.BUFFER,{percentage:pct}); 
     
    8888 
    8989        /** Change the quality mode. **/ 
    90         public function quality(stt:Boolean) { 
     90        public function quality(stt:Boolean):void { 
    9191                try { 
    9292                        Bitmap(loader.content).smoothing = stt; 
     
    9696 
    9797        /** Scrub the image to a certain position. **/ 
    98         public function seek(pos:Number) { 
     98        public function seek(pos:Number):void { 
    9999                clearInterval(interval); 
    100100                position = pos; 
     
    104104 
    105105        /** Stop the image interval. **/ 
    106         public function stop() { 
     106        public function stop():void { 
    107107                flash.media.SoundMixer.stopAll(); 
    108108                clearInterval(interval); 
     
    116116 
    117117        /** Interval function that countdowns the time. **/ 
    118         private function timeInterval() { 
     118        private function timeInterval():void { 
    119119                position = Math.round(position*10+1)/10; 
    120120                var dur = model.playlist[model.config['item']]['duration']; 
     
    130130 
    131131        /** Volume setting **/ 
    132         public function volume(pct:Number) { }; 
     132        public function volume(pct:Number):void { }; 
    133133 
    134134 
  • trunk/as3/com/jeroenwijering/models/ModelInterface.as

    r1 r57  
    1111 
    1212        /** Load a file into the model. **/ 
    13         function load(); 
     13        function load():void; 
    1414        /** Playback resume directive. **/ 
    15         function play(); 
     15        function play():void; 
    1616        /** Playback pause directive. **/ 
    17         function pause(); 
     17        function pause():void; 
    1818        /** Playback seeking directive. **/ 
    19         function seek(pos:Number); 
     19        function seek(pos:Number):void; 
    2020        /** Stop the item altogether. **/ 
    21         function stop(); 
     21        function stop():void; 
    2222        /** Set or toggle the playback quality. **/ 
    23         function quality(stt:Boolean); 
     23        function quality(stt:Boolean):void; 
    2424        /** Change the volume. **/ 
    25         function volume(vol:Number); 
     25        function volume(vol:Number):void; 
    2626 
    2727 
  • trunk/as3/com/jeroenwijering/models/RTMPModel.as

    r53 r57  
    3939 
    4040        /** Constructor; sets up the connection and display. **/ 
    41         public function RTMPModel(mod:Model) { 
     41        public function RTMPModel(mod:Model):void { 
    4242                model = mod; 
    4343                connection = new NetConnection(); 
     
    5656 
    5757        /** Catch security errors. **/ 
    58         private function errorHandler(evt:ErrorEvent) { 
     58        private function errorHandler(evt:ErrorEvent):void { 
    5959                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    6060        }; 
     
    7676 
    7777        /** Load content. **/ 
    78         public function load() { 
     78        public function load():void { 
    7979                connection.connect(model.config['streamer']); 
    8080                model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.BUFFERING}); 
     
    8383 
    8484        /** Catch noncritical errors. **/ 
    85         private function metaHandler(evt:ErrorEvent) { 
     85        private function metaHandler(evt:ErrorEvent):void { 
    8686                model.sendEvent(ModelEvent.META,{error:evt.text}); 
    8787        }; 
     
    8989 
    9090        /** Get metadata information from netstream class. **/ 
    91         public function onData(dat:Object) { 
     91        public function onData(dat:Object):void { 
    9292                if(dat.type == 'metadata' && !metadata) { 
    9393                        metadata = true; 
     
    114114 
    115115        /** Pause playback. **/ 
    116         public function pause() { 
     116        public function pause():void { 
    117117                clearInterval(timeinterval); 
    118118                stream.pause(); 
     
    122122 
    123123        /** Resume playing. **/ 
    124         public function play() { 
     124        public function play():void { 
    125125                clearTimeout(timeout); 
    126126                clearInterval(timeinterval); 
     
    132132 
    133133        /** Change the smoothing mode. **/ 
    134         public function quality(qua:Boolean) { 
     134        public function quality(qua:Boolean):void { 
    135135                if(qua == true) {  
    136136                        video.smoothing = true; 
     
    144144 
    145145        /** Change the smoothing mode. **/ 
    146         public function seek(pos:Number) { 
     146        public function seek(pos:Number):void { 
    147147                clearTimeout(timeout); 
    148148                clearInterval(timeinterval); 
     
    157157 
    158158        /** Set streaming object **/ 
    159         public function setStream() { 
     159        public function setStream():void { 
    160160                var url = getID(model.playlist[model.config['item']]['file']); 
    161161                stream = new NetStream(connection); 
     
    174174 
    175175        /** Receive NetStream status updates. **/ 
    176         private function statusHandler(evt:NetStatusEvent) { 
     176        private function statusHandler(evt:NetStatusEvent):void { 
    177177                if(evt.info.code == "NetConnection.Connect.Success") { 
    178178                        if (evt.info.secureToken != undefined) { 
     
    199199 
    200200        /** Destroy the stream. **/ 
    201         public function stop() { 
     201        public function stop():void { 
    202202                metadata = false; 
    203203                clearInterval(timeinterval); 
     
    209209 
    210210        /** Akamai & Limelight subscribes. **/ 
    211         private function subscribe(nme:String) { 
     211        private function subscribe(nme:String):void { 
    212212                connection.call("FCSubscribe",null,nme); 
    213213        }; 
     
    215215 
    216216        /** Interval for the position progress **/ 
    217         private function timeHandler() { 
     217        private function timeHandler():void { 
    218218                var bfr = Math.round(stream.bufferLength/stream.bufferTime*100); 
    219219                var pos = Math.round(stream.time*10)/10; 
     
    239239 
    240240        /** Set the volume level. **/ 
    241         public function volume(vol:Number) { 
     241        public function volume(vol:Number):void { 
    242242                transform.volume = vol/100; 
    243243                if(stream) {  
  • trunk/as3/com/jeroenwijering/models/SoundModel.as

    r49 r57  
    3737 
    3838        /** Constructor; sets up the connection and display. **/ 
    39         public function SoundModel(mod:Model) { 
     39        public function SoundModel(mod:Model):void { 
    4040                model = mod; 
    4141                transform = new SoundTransform(); 
     
    4646 
    4747        /** Sound completed; send event. **/ 
    48         private function completeHandler(evt:Event) { 
     48        private function completeHandler(evt:Event):void { 
    4949                clearInterval(interval); 
    5050                position = model.playlist[model.config['item']]['start']; 
     
    5555 
    5656        /** Catch errors. **/ 
    57         private function errorHandler(evt:ErrorEvent) { 
     57        private function errorHandler(evt:ErrorEvent):void { 
    5858                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    5959                stop(); 
     
    6262 
    6363        /** Load the sound. **/ 
    64         public function load() { 
     64        public function load():void { 
    6565                position = model.playlist[model.config['item']]['start']; 
    6666                duration = model.playlist[model.config['item']]['duration']; 
     
    7575 
    7676        /** Pause the sound. **/ 
    77         public function pause() { 
     77        public function pause():void { 
    7878                clearInterval(interval); 
    7979                channel.stop(); 
     
    8383 
    8484        /** Play the sound. **/ 
    85         public function play() { 
     85        public function play():void { 
    8686                channel = sound.play(position*1000,0,transform); 
    8787                channel.removeEventListener(Event.SOUND_COMPLETE,completeHandler); 
     
    9393 
    9494        /** Interval for the loading progress **/ 
    95         private function progressHandler(evt:ProgressEvent) { 
     95        private function progressHandler(evt:ProgressEvent):void { 
    9696                var ldd = evt.bytesLoaded; 
    9797                var ttl = evt.bytesTotal; 
     
    101101 
    102102        /** Change quality setting. **/ 
    103         public function quality(typ:Boolean) {}; 
     103        public function quality(typ:Boolean):void {}; 
    104104 
    105105 
    106106        /** Seek in the sound. **/ 
    107         public function seek(pos:Number) { 
     107        public function seek(pos:Number):void { 
    108108                clearInterval(interval); 
    109109                position = pos; 
     
    114114 
    115115        /** Destroy the sound. **/ 
    116         public function stop() { 
     116        public function stop():void { 
    117117                clearInterval(interval); 
    118118                if(channel) { channel.stop(); } 
     
    124124 
    125125        /** Interval for the position progress **/ 
    126         private function timeHandler() { 
     126        private function timeHandler():void { 
    127127                position = Math.round(channel.position/100)/10; 
    128128                var dur = Math.round(sound.length*sound.bytesTotal/sound.bytesLoaded/100)/10; 
     
    148148 
    149149        /** Set the volume level. **/ 
    150         public function volume(vol:Number) { 
     150        public function volume(vol:Number):void { 
    151151                transform.volume = vol/100; 
    152152                if(channel) { 
  • trunk/as3/com/jeroenwijering/models/VideoModel.as

    r53 r57  
    4040 
    4141        /** Constructor; sets up the connection and display. **/ 
    42         public function VideoModel(mod:Model) { 
     42        public function VideoModel(mod:Model):void { 
    4343                model = mod; 
    4444                connection = new NetConnection(); 
     
    6363 
    6464        /** Catch security errors. **/ 
    65         private function errorHandler(evt:ErrorEvent) { 
     65        private function errorHandler(evt:ErrorEvent):void { 
    6666                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    6767        }; 
     
    6969 
    7070        /** Load content. **/ 
    71         public function load() { 
     71        public function load():void { 
    7272                stream.play(model.playlist[model.config['item']]['file']); 
    7373                loadinterval = setInterval(loadHandler,100); 
     
    7878 
    7979        /** Interval for the loading progress **/ 
    80         private function loadHandler() {  
     80        private function loadHandler():void {  
    8181                var ldd = stream.bytesLoaded; 
    8282                var ttl = stream.bytesTotal; 
     
    8989 
    9090        /** Catch noncritical errors. **/ 
    91         private function metaHandler(evt:ErrorEvent) { 
     91        private function metaHandler(evt:ErrorEvent):void { 
    9292                model.sendEvent(ModelEvent.META,{error:evt.text}); 
    9393        }; 
     
    9595 
    9696        /** Get metadata information from netstream class. **/ 
    97         public function onData(dat:Object) { 
     97        public function onData(dat:Object):void { 
    9898                if(dat.type == 'metadata' && !metadata) { 
    9999                        metadata = true; 
     
    114114 
    115115        /** Pause playback. **/ 
    116         public function pause() { 
     116        public function pause():void { 
    117117                clearInterval(timeinterval); 
    118118                stream.pause(); 
     
    122122 
    123123        /** Resume playing. **/ 
    124         public function play() { 
     124        public function play():void { 
    125125                stream.resume(); 
    126126                timeinterval = setInterval(timeHandler,100); 
     
    130130 
    131131        /** Change the smoothing mode. **/ 
    132         public function quality(qua:Boolean) { 
     132        public function quality(qua:Boolean):void { 
    133133                if(qua == true) {  
    134134                        video.smoothing = true; 
     
    142142 
    143143        /** Change the smoothing mode. **/ 
    144         public function seek(pos:Number) { 
     144        public function seek(pos:Number):void { 
    145145                clearInterval(timeinterval); 
    146146                stream.seek(pos); 
     
    150150 
    151151        /** Receive NetStream status updates. **/ 
    152         private function statusHandler(evt:NetStatusEvent) { 
     152        private function statusHandler(evt:NetStatusEvent):void { 
    153153                if(evt.info.code == "NetStream.Play.Stop" && stream.bytesLoaded == stream.bytesTotal) { 
    154154                        clearInterval(timeinterval); 
     
    163163 
    164164        /** Destroy the video. **/ 
    165         public function stop() { 
     165        public function stop():void { 
    166166                if(stream.bytesLoaded != stream.bytesTotal) { 
    167167                        stream.close(); 
     
    175175 
    176176        /** Interval for the position progress **/ 
    177         private function timeHandler() { 
     177        private function timeHandler():void { 
    178178                var bfr = Math.round(stream.bufferLength/stream.bufferTime*100); 
    179179                var pos = Math.round(stream.time*10)/10; 
     
    199199 
    200200        /** Set the volume level. **/ 
    201         public function volume(vol:Number) { 
     201        public function volume(vol:Number):void { 
    202202                transform.volume = vol/100; 
    203203                stream.soundTransform = transform; 
  • trunk/as3/com/jeroenwijering/models/YoutubeModel.as

    r38 r57  
    3838 
    3939        /** Setup YouTube connections and load proxy. **/ 
    40         public function YoutubeModel(mod:Model) { 
     40        public function YoutubeModel(mod:Model):void { 
    4141                model = mod; 
    4242                outgoing = new LocalConnection(); 
     
    6565 
    6666        /** Catch load errors. **/ 
    67         private function errorHandler(evt:ErrorEvent) { 
     67        private function errorHandler(evt:ErrorEvent):void { 
    6868                model.sendEvent(ModelEvent.ERROR,{message:evt.text}); 
    6969        }; 
     
    8585 
    8686        /** Load the YouTube movie. **/ 
    87         public function load() { 
     87        public function load():void { 
    8888                if(connected) { 
    8989                        model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.BUFFERING}); 
     
    100100 
    101101        /** Pause the YouTube movie. **/ 
    102         public function pause() { 
     102        public function pause():void { 
    103103                outgoing.send("_AS3_to_AS2","pauseVideo"); 
    104104        }; 
     
    107107 
    108108        /** Play or pause the video. **/ 
    109         public function play() { 
     109        public function play():void { 
    110110                outgoing.send("_AS3_to_AS2","playVideo"); 
    111111        }; 
     
    113113 
    114114        /** SWF loaded; add it to the tree **/ 
    115         public function onSwfLoadComplete() { 
     115        public function onSwfLoadComplete():void { 
    116116                outgoing.send("_AS3_to_AS2","setSize",320,240); 
    117117                model.config['mute'] == true ? volume(0): volume(model.config['volume']); 
     
    121121 
    122122        /** error was thrown without this handler **/ 
    123         public function onLocalConnectionStatusChange(evt:StatusEvent) { 
     123        public function onLocalConnectionStatusChange(evt:StatusEvent):void { 
    124124                // model.sendEvent(ModelEvent.META,{status:evt.code}); 
    125125        }; 
     
    127127 
    128128        /** Catch youtube errors. **/ 
    129         public function onError(erc:String) { 
     129        public function onError(erc:String):void { 
    130130                var fil = model.playlist[model.config['item']]['file']; 
    131131                model.sendEvent(ModelEvent.ERROR,{message:"YouTube error (video not found?):\n"+fil}); 
     
    135135 
    136136        /** Catch youtube state changes. **/ 
    137         public function onStateChange(stt:Number) { 
     137        public function onStateChange(stt:Number):void { 
    138138                switch(Number(stt)) { 
    139139                        case -1: 
     
    160160 
    161161        /** Catch Youtube load changes **/ 
    162         public function onLoadChange(ldd:Number,ttl:Number,off:Number) { 
     162        public function onLoadChange(ldd:Number,ttl:Number,off:Number):void { 
    163163                model.sendEvent(ModelEvent.LOADED,{loaded:ldd,total:ttl,offset:off}); 
    164164        }; 
     
    166166 
    167167        /** Catch Youtube position changes **/ 
    168         public function onTimeChange(pos:Number,dur:Number) { 
     168        public function onTimeChange(pos:Number,dur:Number):void { 
    169169                model.sendEvent(ModelEvent.TIME,{position:pos,duration:dur}); 
    170170                if(!metasent) { 
     
    176176 
    177177        /** Toggle quality (perhaps access the H264 versions later?). **/ 
    178         public function quality(stt:Boolean) {}; 
     178        public function quality(stt:Boolean):void {}; 
    179179 
    180180 
    181181        /** Seek to position. **/ 
    182         public function seek(pos:Number) { 
     182        public function seek(pos:Number):void { 
    183183                outgoing.send("_AS3_to_AS2","seekTo",pos); 
    184184                play(); 
     
    187187 
    188188        /** Destroy the youtube video. **/ 
    189         public function stop() { 
     189        public function stop():void { 
    190190                outgoing.send("_AS3_to_AS2","stopVideo"); 
    191191        }; 
     
    194194 
    195195        /** Set the volume level. **/ 
    196         public function volume(pct:Number) { 
     196        public function volume(pct:Number):void { 
    197197                outgoing.send("_AS3_to_AS2","setVolume",pct); 
    198198        }; 
  • trunk/as3/com/jeroenwijering/parsers/SMILParser.as

    r14 r57  
    9090 
    9191        /** Get attributes from a SMIL element. **/ 
    92         public static function parseAttributes(obj:Object,itm:Object) { 
     92        public static function parseAttributes(obj:Object,itm:Object):Object { 
    9393                for(var i=0; i<obj.attributes().length(); i++) { 
    9494                        var att = String(obj.attributes()[i].name()); 
  • trunk/as3/com/jeroenwijering/player/Controller.as

    r54 r57  
    3333 
    3434        /** Constructor, set up stage and playlist listeners. **/ 
    35         public function Controller(cfg:Object,skn:MovieClip) { 
     35        public function Controller(cfg:Object,skn:MovieClip):void { 
    3636                config = cfg; 
    3737                skin = skn; 
     
    4747 
    4848        /** Register view and model with controller, start loading playlist. **/ 
    49         public function start(mdl:Model,vie:View) { 
     49        public function start(mdl:Model,vie:View):void { 
    5050                model= mdl; 
    5151                model.addEventListener(ModelEvent.META,metaHandler); 
     
    7878 
    7979        /** Catch errors dispatched by the playlister. **/ 
    80         private function errorHandler(evt:ErrorEvent) { 
     80        private function errorHandler(evt:ErrorEvent):void { 
    8181                dispatchEvent(new ControllerEvent(ControllerEvent.ERROR,{message:evt.text})); 
    8282        }; 
     
    8484 
    8585        /** Switch fullscreen state. **/ 
    86         private function fullscreenHandler(evt:ViewEvent) { 
     86        private function fullscreenHandler(evt:ViewEvent):void { 
    8787                if(skin.stage['displayState'] == 'fullScreen') { 
    8888                        skin.stage['displayState'] = 'normal'; 
     
    9595 
    9696        /** Set the fullscreen rectangle **/ 
    97         private function fullscreenrect() { 
     97        private function fullscreenrect():void { 
    9898                try {  
    9999                        skin.stage["fullScreenSourceRect"] = new Rectangle(0,0, 
     
    104104 
    105105        /** Jump to a userdefined item in the playlist. **/ 
    106         private function itemHandler(evt:ViewEvent) { 
     106        private function itemHandler(evt:ViewEvent):void { 
    107107                var itm = evt.data.index; 
    108108                if (itm < 0) { 
     
    117117 
    118118        /** Jump to the link of a playlistitem. **/ 
    119         private function linkHandler(evt:ViewEvent) { 
     119        private function linkHandler(evt:ViewEvent):void { 
    120120                var itm = evt.data.index; 
    121121                if (itm  == undefined) { 
     
    130130 
    131131        /** Load a new playlist. **/ 
    132         private function loadHandler(evt:ViewEvent) { 
     132        private function loadHandler(evt:ViewEvent):void { 
    133133                stopHandler(); 
    134134                try { 
     
    142142 
    143143        /** Update playlist item duration. **/ 
    144         private function metaHandler(evt:ModelEvent) { 
     144        private function metaHandler(evt:ModelEvent):void { 
    145145                if(evt.data.duration) { 
    146146                        var dur = Math.round(evt.data.duration*10)/10 
     
    151151 
    152152        /** Save new state of the mute switch and send volume. **/ 
    153         private function muteHandler(evt:ViewEvent) { 
     153        private function muteHandler(evt:ViewEvent):void { 
    154154                if(evt.data.state) { 
    155155                        if(evt.data.state == config['mute']) { 
     
    166166 
    167167        /** Jump to the next item in the playlist. **/ 
    168         private function nextHandler(evt:ViewEvent) { 
     168        private function nextHandler(evt:ViewEvent):void { 
    169169                if(playlist && config['shuffle'] == true) {  
    170170                        playItem(randomizer.pick()); 
     
    178178 
    179179        /** Change the playback state. **/ 
    180         private function playHandler(evt:ViewEvent) { 
     180        private function playHandler(evt:ViewEvent):void { 
    181181                if(playlist) { 
    182182                        if(evt.data.state != false && config['state'] == ModelStates.PAUSED) { 
     
    195195 
    196196        /** Direct the model to play a new item. **/ 
    197         private function playItem(nbr:Number=undefined) { 
     197        private function playItem(nbr:Number=undefined):void { 
    198198                if(nbr > -1) { 
    199199                        if(playlist[nbr]['file'] == playlist[config['item']]['file']) { 
     
    207207 
    208208        /** Manage loading of a new playlist. **/ 
    209         private function playlistHandler(evt:Event) { 
     209        private function playlistHandler(evt:Event):void { 
    210210                if(config['shuffle'] == true) { 
    211211                        randomizer = new Randomizer(playlist.length); 
     
    222222 
    223223        /** Jump to the previous item in the playlist. **/ 
    224         private function prevHandler(evt:ViewEvent) { 
     224        private function prevHandler(evt:ViewEvent):void { 
    225225                if (config['item'] == 0) { 
    226226                        playItem(playlist.length-1); 
     
    232232 
    233233        /** Switch playback quality. **/ 
    234         private function qualityHandler(evt:ViewEvent=null) { 
     234        private function qualityHandler(evt:ViewEvent=null):void { 
    235235                if(evt.data.state != undefined) { 
    236236                        if(evt.data.state == config['quality']) { 
     
    248248 
    249249        /** Forward a resizing of the stage. **/ 
    250         private function resizeHandler(evt:ViewEvent) { 
     250        private function resizeHandler(evt:ViewEvent):void { 
    251251                var mgn = config['margins'].split(','); 
    252252                var dat = { 
     
    277277 
    278278        /** Seek to a specific part in a mediafile. **/ 
    279         private function seekHandler(evt:ViewEvent) { 
     279        private function seekHandler(evt:ViewEvent):void { 
    280280                if(config['state'] != ModelStates.IDLE && playlist[config['item']]['duration'] > 0) { 
    281281                        var pos = evt.data.position; 
     
    291291 
    292292        /** Stop all playback and buffering. **/ 
    293         private function stopHandler(evt:ViewEvent=undefined) { 
     293        private function stopHandler(evt:ViewEvent=undefined):void { 
    294294                dispatchEvent(new ControllerEvent(ControllerEvent.STOP)); 
    295295        }; 
     
    297297 
    298298        /** Manage playback state changes. **/ 
    299         private function stateHandler(evt:ModelEvent) { 
     299        private function stateHandler(evt:ModelEvent):void { 
    300300                if(evt.data.newstate == ModelStates.COMPLETED && (config['repeat'] == 'always' || 
    301301                        (config['repeat'] == 'list' && config['shuffle'] == true && randomizer.length > 0) ||  
     
    313313 
    314314        /** Save new state of the mute switch and send volume. **/ 
    315         private function volumeHandler(evt:ViewEvent) { 
     315        private function volumeHandler(evt:ViewEvent):void { 
    316316                var vol = evt.data.percentage; 
    317317                if (vol < 1) { 
  • trunk/as3/com/jeroenwijering/player/Model.as

    r54 r57  
    3636 
    3737        /** Constructor, save arrays and set currentItem. **/ 
    38         public function Model(cfg:Object,skn:MovieClip,ctr:Controller) { 
     38        public function Model(cfg:Object,skn:MovieClip,ctr:Controller):void { 
    3939                config = cfg; 
    4040                skin = skn; 
     
    5757 
    5858        /** Item change: switch the curently active model if there's a new URL **/ 
    59         private function itemHandler(evt:ControllerEvent) { 
     59        private function itemHandler(evt:ControllerEvent):void { 
    6060                var typ = playlist[evt.data.index]['type']; 
    6161                var url = playlist[evt.data.index]['file']; 
     
    8383 
    8484        /** Setup a new model. **/ 
    85         private function loadModel(typ:String) { 
     85        private function loadModel(typ:String):void { 
    8686                switch(typ) { 
    8787                        case 'camera': 
     
    117117 
    118118        /** Place a loaded mediafile on stage **/ 
    119         public function mediaHandler(chd:DisplayObject=undefined) { 
     119        public function mediaHandler(chd:DisplayObject=undefined):void { 
    120120                var obj = skin.display.media; 
    121121                Draw.clear(obj); 
     
    130130 
    131131        /** Load the configuration array. **/ 
    132         private function muteHandler(evt:ControllerEvent) { 
     132        private function muteHandler(evt:ControllerEvent):void { 
    133133                if(currentModel && evt.data.state == true) { 
    134134                        models[currentModel].volume(0);  
     
    140140 
    141141        /** Togge the playback state. **/ 
    142         private function playHandler(evt:ControllerEvent) { 
     142        private function playHandler(evt:ControllerEvent):void { 
    143143                if(currentModel) { 
    144144                        if(evt.data.state == true) { 
     
    152152 
    153153        /** Send an idle with new playlist. **/ 
    154         private function playlistHandler(evt:ControllerEvent) { 
     154        private function playlistHandler(evt:ControllerEvent):void { 
    155155                if(currentModel) {  
    156156                        stopHandler();  
     
    163163 
    164164        /** Toggle the playback quality. **/ 
    165         private function qualityHandler(evt:ControllerEvent) { 
     165        private function qualityHandler(evt:ControllerEvent):void { 
    166166                if(currentModel) { 
    167167                        models[currentModel].quality(evt.data.state); 
     
    171171 
    172172        /** Resize the media and thumb. **/ 
    173         private function resizeHandler(evt:ControllerEvent) { 
     173        private function resizeHandler(evt:ControllerEvent):void { 
    174174                Stretcher.stretch(skin.display.media,evt.data.width,evt.data.height,config['stretching']); 
    175175        }; 
     
    177177 
    178178        /** Seek inside a file. **/ 
    179         private function seekHandler(evt:ControllerEvent) { 
     179        private function seekHandler(evt:ControllerEvent):void { 
    180180                if(currentModel) { 
    181181                        models[currentModel].seek(evt.data.position); 
     
    185185 
    186186        /** Load the configuration array. **/ 
    187         private function stopHandler(evt:ControllerEvent=undefined) { 
     187        private function stopHandler(evt:ControllerEvent=undefined):void { 
    188188                currentURL = undefined; 
    189189                if(currentModel) { 
     
    197197 
    198198        /**  Dispatch events. State switch is saved. **/ 
    199         public function sendEvent(typ:String,dat:Object) { 
     199        public function sendEvent(typ:String,dat:Object):void { 
    200200                if(typ == ModelEvent.STATE && dat.newstate != config['state']) { 
    201201                        dat.oldstate = config['state']; 
     
    215215 
    216216        /** Load a thumb on stage. **/ 
    217         private function thumbLoader() { 
     217        private function thumbLoader():void { 
    218218                var img = playlist[config['item']]['image']; 
    219219                if(img) { 
     
    223223 
    224224        /** Place a loaded thumb on stage. **/ 
    225         private function thumbHandler(evt:Event=null) { 
     225        private function thumbHandler(evt:Event=null):void { 
    226226                mediaHandler(loader); 
    227227        }; 
     
    229229 
    230230        /** Load the configuration array. **/ 
    231         private function volumeHandler(evt:ControllerEvent) { 
     231        private function volumeHandler(evt:ControllerEvent):void { 
    232232                if(currentModel) { 
    233233                        models[currentModel].volume(evt.data.percentage); 
  • trunk/as3/com/jeroenwijering/player/Player.as

    r56 r57  
    6363                token:undefined, 
    6464                tracecall:undefined, 
    65                 version:'4.1.55' 
     65                version:'4.1.56' 
    6666        }; 
    6767        /** Object that loads all configuration variables. **/ 
     
    8080 
    8181        /** Constructor; Loads config parameters. **/ 
    82         public function Player() { 
     82        public function Player():void { 
    8383                visible = false; 
    8484                plugins = new Array(); 
     
    9090 
    9191        /** Config loading completed; now load skin. **/ 
    92         private function configHandler(evt:Event) { 
     92        private function configHandler(evt:Event):void { 
    9393                loader = new SWFLoader(this); 
    9494                loader.addEventListener(Event.INIT,skinHandler); 
     
    9999 
    100100        /** Skin loading completed, now load MVC and plugins. **/ 
    101         private function skinHandler(evt:Event) { 
     101        private function skinHandler(evt:Event):void { 
    102102                controller = new Controller(configger.config,loader.skin); 
    103103                model = new Model(configger.config,loader.skin,controller); 
     
    116116        * @prm plg              Any object that implements the PluginInterface. 
    117117        **/ 
    118         public function addPlugin(plg:Object) { 
     118        public function addPlugin(plg:Object):void { 
    119119                plugins.push(plg); 
    120120        }; 
     
    122122 
    123123        /** Plugin loading completed; let's start! **/ 
    124         private function pluginHandler(evt:Event=null) { 
     124        private function pluginHandler(evt:Event=null):void { 
    125125                for(var i=0; i<plugins.length; i++) { plugins[i].initializePlugin(_view); } 
    126126                controller.start(model,_view); 
  • trunk/as3/com/jeroenwijering/player/SWFLoader.as

    r52 r57  
    3535        * @param ply    The player instance. 
    3636        **/ 
    37         public function SWFLoader(ply:MovieClip) { 
     37        public function SWFLoader(ply:MovieClip):void { 
    3838                player = ply; 
    3939                amount = 0; 
     
    4646        * @prm pgi              A commaseparated list with plugins.  
    4747        **/ 
    48         public function loadPlugins(pgi:String=null) { 
     48        public function loadPlugins(pgi:String=null):void { 
    4949                if(pgi) { 
    5050                        var arr = pgi.split(','); 
     
    6262        * @param cfg    Object that contains all configuration parameters. 
    6363        **/ 
    64         public function loadSkin(skn:String=null) { 
     64        public function loadSkin(skn:String=null):void { 
    6565                if(skn) { 
    6666                        loadSWF(skn,true); 
     
    7373 
    7474        /** Load a particular SWF file. **/ 
    75         public function loadSWF(str:String,skn:Boolean) { 
     75        public function loadSWF(str:String,skn:Boolean):void { 
    7676                if(str.substr(-4) != '.swf') { str += '.swf'; } 
    7777                var ldr = new Loader(); 
     
    9898 
    9999        /** SWF loading failed; use default skin. **/ 
    100         private function pluginError(evt:IOErrorEvent) { 
     100        private function pluginError(evt:IOErrorEvent):void { 
    101101                amount--; 
    102102                if (amount == 0) { 
     
    107107 
    108108        /** Plugin loading completed; add to stage and populate. **/ 
    109         private function pluginHandler(evt:Event) { 
     109        private function pluginHandler(evt:Event):void { 
    110110                var clp = evt.target.content; 
    111111                player.addPlugin(clp); 
     
    118118 
    119119        /** SWF loading failed; use default skin. **/ 
    120         private function skinError(evt:IOErrorEvent=null) { 
     120        private function skinError(evt:IOErrorEvent=null):void { 
    121121                skin = player['player']; 
    122122                dispatchEvent(new Event(Event.INIT)); 
     
    125125 
    126126        /** Skin loading completed; add to stage and populate. **/ 
    127         private function skinHandler(evt:Event) { 
     127        private function skinHandler(evt:Event):void { 
    128128                var clp = evt.target.content; 
    129129                if(clp['player']) { 
  • trunk/as3/com/jeroenwijering/player/View.as

    r54 r57  
    3636 
    3737        /** Constructor, save references and subscribe to events. **/ 
    38         public function View(cfg:Object,skn:MovieClip,ctr:Controller,mdl:Model) { 
     38        public function View(cfg:Object,skn:MovieClip,ctr:Controller,mdl:Model):void { 
    3939                _config = cfg; 
    4040                _config['client'] = 'FLASH '+Capabilities.version; 
     
    7777 
    7878        /** jump to the about page. **/ 
    79         private function aboutSetter(evt:ContextMenuEvent) { 
     79        private function aboutSetter(evt:ContextMenuEvent):void { 
    8080                navigateToURL(new URLRequest(config['aboutlink']),'_blank'); 
    8181        }; 
     
    8383 
    8484        /**  Subscribers to the controller and model. **/ 
    85         override public function addControllerListener(typ:String,fcn:Function) { 
     85        override public function addControllerListener(typ:String,fcn:Function):void { 
    8686                controller.addEventListener(typ.toUpperCase(),fcn); 
    8787        }; 
     
    9090                return true; 
    9191        }; 
    92         override public function addModelListener(typ:String,fcn:Function) { 
     92        override public function addModelListener(typ:String,fcn:Function):void { 
    9393                model.addEventListener(typ.toUpperCase(),fcn); 
    9494        }; 
     
    9797                return true; 
    9898        }; 
    99         override public function addViewListener(typ:String,fcn:Function) { 
     99        override public function addViewListener(typ:String,fcn:Function):void { 
    100100                this.addEventListener(typ.toUpperCase(),fcn); 
    101101        }; 
     
    107107 
    108108        /** Send event to listeners and tracers. **/ 
    109         private function forward(tgt:String,typ:String,dat:Object) { 
     109        private function forward(tgt:String,typ:String,dat:Object):void { 
    110110                var prm = ''; 
    111111                for (var i in dat) { prm += i+':'+dat[i]+','; } 
     
    131131 
    132132        /** Toggle the fullscreen mode. **/ 
    133         private function fullscreenSetter(evt:ContextMenuEvent) { sendEvent('fullscreen'); }; 
     133        private function fullscreenSetter(evt:ContextMenuEvent):void { sendEvent('fullscreen'); }; 
    134134 
    135135 
    136136        /** Add a custom menu item. **/ 
    137         private function menuAdd(itm:ContextMenuItem,hdl:Function) { 
     137        private function menuAdd(itm:ContextMenuItem,hdl:Function):void { 
    138138                itm.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,hdl); 
    139139                itm.separatorBefore = true; 
     
    143143 
    144144        /** Set the rightclick menu. **/ 
    145         private function menuSet() { 
     145        private function menuSet():void { 
    146146                context = new ContextMenu(); 
    147147                context.hideBuiltInItems(); 
     
    169169 
    170170        /** Send a call to javascript that the player is ready. **/ 
    171         private function playerReady() { 
     171        private function playerReady():void { 
    172172                var dat = { 
    173173                        id:config['id'], 
     
    182182 
    183183        /** Toggle the smoothing mode. **/ 
    184         private function qualityHandler(evt:ControllerEvent) { 
     184        private function qualityHandler(evt:ControllerEvent):void { 
    185185                if(evt.data.state == true) { 
    186186                        context.customItems[0].caption = "Switch to low quality"; 
     
    192192 
    193193        /** Toggle the smoothing mode. **/ 
    194         private function qualitySetter(evt:ContextMenuEvent) { sendEvent('quality'); }; 
     194        private function qualitySetter(evt:ContextMenuEvent):void { sendEvent('quality'); }; 
    195195 
    196196 
    197197        /** Set the fullscreen menubutton. **/ 
    198         private function resizeHandler(evt:ControllerEvent) { 
     198        private function resizeHandler(evt:ControllerEvent):void { 
    199199                if(evt.data.fullscreen == false) {  
    200200                        context.customItems[1].caption = "Switch to fullscreen"; 
     
    206206 
    207207        /** Forward a resizing of the stage. **/ 
    208         private function resizeSetter(evt:Event=undefined) { 
     208        private function resizeSetter(evt:Event=undefined):void { 
    209209                var dat = { 
    210210                        height:_skin.stage.stageHeight, 
     
    216216 
    217217        /**  Dispatch events. **/ 
    218         override public function sendEvent(typ:String,prm:Object=undefined) { 
     218        override public function sendEvent(typ:String,prm:Object=undefined):void { 
    219219                typ = typ.toUpperCase(); 
    220220                var dat = new Object(); 
     
    257257 
    258258        /** Forward events to tracer and subscribers. **/ 
    259         private function setController(evt:ControllerEvent) { forward('CONTROLLER',evt.type,evt.data); }; 
    260         private function setModel(evt:ModelEvent) { forward('MODEL',evt.type,evt.data); }; 
    261         private function setView(evt:ViewEvent) { forward('VIEW',evt.type,evt.data); }; 
     259        private function setController(evt:ControllerEvent):void { forward('CONTROLLER',evt.type,evt.data); }; 
     260        private function setModel(evt:ModelEvent):void { forward('MODEL',evt.type,evt.data); }; 
     261        private function setView(evt:ViewEvent):void { forward('VIEW',evt.type,evt.data); }; 
    262262 
    263263 
    264264        /** Setup listeners to all events for tracing / javascript. **/ 
    265         private function setListening() { 
     265        private function setListening():void { 
    266266                addControllerListener(ControllerEvent.ERROR,setController); 
    267267                addControllerListener(ControllerEvent.ITEM,setController); 
  • trunk/as3/com/jeroenwijering/plugins/Captions.as

    r56 r57  
    3636 
    3737 
    38         public function Captions() {}; 
     38        public function Captions():void {}; 
    3939 
    4040 
    4141        /** Initing the plugin. **/ 
    42         public function initializePlugin(vie:AbstractView) { 
     42        public function initializePlugin(vie:AbstractView):void { 
    4343                view = vie; 
    4444                if(!view.skin['captions']) { return; } 
     
    5656 
    5757        /** Check for captions with a new item. **/ 
    58         private function itemHandler(evt:ControllerEvent) { 
     58        private function itemHandler(evt:ControllerEvent):void { 
    5959                current = -1; 
    6060                setCaption(''); 
     
    7474 
    7575        /** Captions are loaded; now display them. **/ 
    76         private function loaderHandler(evt:Event) { 
     76        private function loaderHandler(evt:Event):void { 
    7777                try { 
    7878                        var dat = XML(evt.target.data); 
     
    9191 
    9292        /** Resize the captions if the display changes. **/ 
    93         private function resizeHandler(evt:ControllerEvent=undefined) { 
     93        private function resizeHandler(evt:ControllerEvent=undefined):void { 
    9494                clip.back.height = clip.field.height+15; 
    9595                clip.width = view.config['width']; 
     
    100100 
    101101        /** Catch and display captions that are sent through metadata. **/ 
    102         private function metaHandler(evt:ModelEvent) { 
     102        private function metaHandler(evt:ModelEvent):void { 
    103103                if (evt.data.text != undefined && evt.data.trackid != undefined) { 
    104104                        setCaption(evt.data.text); 
     
    110110 
    111111        /** Set a caption on screen. **/ 
    112         private function setCaption(txt:String) { 
     112        private function setCaption(txt:String):void { 
    113113                clip.visible = true; 
    114114                clip.field.htmlText = txt; 
     
    118118 
    119119        /** Check the playback state; hide captions if not playing. **/ 
    120         private function stateHandler(evt:ModelEvent) { 
     120        private function stateHandler(evt:ModelEvent):void { 
    121121                if(view.config['caption'] == true) { 
    122122                        clip.visible = true; 
     
    128128 
    129129        /** Check timing of the player to sync captions.  **/ 
    130         private function timeHandler(evt:ModelEvent) { 
     130        private function timeHandler(evt:ModelEvent):void { 
    131131                var cur = -1; 
    132132                var pos = evt.data.position; 
  • trunk/as3/com/jeroenwijering/plugins/Controlbar.as

    r56 r57  
    5656 
    5757        /** Constructor. **/ 
    58         public function Controlbar() {}; 
     58        public function Controlbar():void {}; 
    5959 
    6060 
    6161        /** Initialize from view. **/ 
    62         public function initializePlugin(vie:AbstractView) { 
     62        public function initializePlugin(vie:AbstractView):void { 
    6363                view = vie; 
    6464                view.addControllerListener(ControllerEvent.RESIZE,resizeHandler); 
     
    8686 
    8787        /** Handle clicks from all buttons. **/ 
    88         private function clickHandler(evt:MouseEvent) { 
     88        private function clickHandler(evt:MouseEvent):void { 
    8989                view.sendEvent(BUTTONS[evt.target.name]); 
    9090        }; 
     
    9292 
    9393        /** Handle mouse presses on sliders. **/ 
    94         private function downHandler(evt:MouseEvent) { 
     94        private function downHandler(evt:MouseEvent):void { 
    9595                var tgt = evt.target; 
    9696                var rct = new Rectangle(tgt.rail.x,tgt.icon.y,tgt.rail.width-tgt.icon.width,0); 
     
    102102 
    103103        /** Fix the timeline display. **/ 
    104         private function fixTime() { 
     104        private function fixTime():void { 
    105105                try { 
    106106                        var scp = bar.timeSlider.scaleX; 
     
    115115 
    116116        /** Handle a change in the current item **/ 
    117         private function itemHandler(evt:ControllerEvent=null) { 
     117        private function itemHandler(evt:ControllerEvent=null):void { 
    118118                try { 
    119119                        if(view.playlist && view.playlist.length > 1) { 
     
    137137 
    138138        /** Process bytesloaded updates given by the model. **/ 
    139         private function loadedHandler(evt:ModelEvent=null) { 
     139        private function loadedHandler(evt:ModelEvent=null):void { 
    140140                var pc1 = 0; 
    141141                if(evt && evt.data.total > 0) { 
     
    155155 
    156156        /** Show above controlbar on mousemove. **/ 
    157         private function moveHandler(evt:MouseEvent=null) { 
     157        private function moveHandler(evt:MouseEvent=null):void { 
    158158                if(bar.alpha == 0) { Animations.fade(bar,1); } 
    159159                clearTimeout(hiding); 
     
    164164 
    165165        /** Hide above controlbar again when move has timed out. **/ 
    166         private function moveTimeout() { 
     166        private function moveTimeout():void { 
    167167                if((bar.mouseY<0 || bar.mouseY>bar.height)  && bar.alpha == 1) { 
    168168                        Animations.fade(bar,0); 
     
    173173 
    174174        /** Show a mute icon if playing. **/ 
    175         private function muteHandler(evt:ControllerEvent=null) { 
     175        private function muteHandler(evt:ControllerEvent=null):void { 
    176176                try { 
    177177                        if(view.config['mute'] == true) { 
     
    191191 
    192192        /** Handle mouseouts from all buttons **/ 
    193         private function outHandler(evt:MouseEvent) { 
     193        private function outHandler(evt:MouseEvent):void { 
    194194                if(front) {  
    195195                        bar[evt.target.name]['icon'].transform.colorTransform = front; 
     
    201201 
    202202        /** Handle clicks from all buttons **/ 
    203         private function overHandler(evt:MouseEvent) { 
     203        private function overHandler(evt:MouseEvent):void { 
    204204                if(light) {  
    205205                        bar[evt.target.name]['icon'].transform.colorTransform = light; 
     
    211211 
    212212        /** Process resizing requests **/ 
    213         private function resizeHandler(evt:ControllerEvent=null) { 
     213        private function resizeHandler(evt:ControllerEvent=null):void { 
    214214                var wid = stacker.width; 
    215215                if(view.config['controlbar'] == 'over' || (evt && evt.data.fullscreen == true)) { 
     
    256256 
    257257        /** Clickhandler for all buttons. **/ 
    258         private function setButtons() { 
     258        private function setButtons():void { 
    259259                for(var btn in BUTTONS) { 
    260260                        if(bar[btn]) { 
     
    279279 
    280280        /** Init the colors. **/ 
    281         private function setColors() { 
     281        private function setColors():void { 
    282282                if(view.config['backcolor']) {  
    283283                        var clr = new ColorTransform(); 
     
    313313 
    314314        /** Process state changes **/ 
    315         private function stateHandler(evt:ModelEvent=undefined) { 
     315        private function stateHandler(evt:ModelEvent=undefined):void { 
    316316                clearTimeout(hiding); 
    317317                view.skin.removeEventListener(MouseEvent.MOUSE_MOVE,moveHandler); 
     
    347347 
    348348        /** Process time updates given by the model. **/ 
    349         private function timeHandler(evt:ModelEvent=null) { 
     349        private function timeHandler(evt:ModelEvent=null):void { 
    350350                var dur = 0; 
    351351                var pos = 0; 
     
    380380 
    381381        /** Handle mouse releases on sliders. **/ 
    382         private function upHandler(evt:MouseEvent) { 
     382        private function upHandler(evt:MouseEvent):void { 
    383383                var tgt = evt.target; 
    384384                var mpl = 0; 
     
    397397 
    398398        /** Reflect the new volume in the controlbar **/ 
    399         private function volumeHandler(evt:ControllerEvent=null) { 
     399        private function volumeHandler(evt:ControllerEvent=null):void { 
    400400                try {  
    401401                        var vsl = bar.volumeSlider; 
  • trunk/as3/com/jeroenwijering/plugins/Display.as

    r56 r57  
    4343 
    4444        /** Constructor; add all needed listeners. **/ 
    45         public function Display() {}; 
     45        public function Display():void {}; 
    4646 
    4747 
    4848        /** Initialize the plugin. **/ 
    49         public function initializePlugin(vie:AbstractView) { 
     49        public function initializePlugin(vie:AbstractView):void { 
    5050                view = vie; 
    5151                view.addControllerListener(ControllerEvent.ERROR,errorHandler); 
     
    7777 
    7878        /** Receive buffer updates. **/ 
    79         private function bufferHandler(evt:ModelEvent) { 
     79        private function bufferHandler(evt:ModelEvent):void { 
    8080                var pct = ''; 
    8181                if(evt.data.percentage > 0) { 
     
    8989 
    9090        /** Process a click on the display. **/ 
    91         private function clickHandler(evt:MouseEvent) { 
     91        private function clickHandler(evt:MouseEvent):void { 
    9292                view.sendEvent(view.config['displayclick']); 
    9393        }; 
     
    9595 
    9696        /** Receive and print errors. **/ 
    97         private function errorHandler(evt:Object) { 
     97        private function errorHandler(evt:Object):void { 
    9898                setIcon('errorIcon'); 
    9999                try {  
     
    104104 
    105105        /** Logo loaded; now position it. **/ 
    106         private function logoHandler(evt:Event) { 
     106        private function logoHandler(evt:Event):void { 
    107107                if(margins[0] > margins[2]) {  
    108108                        display.logo.x = display.back.width- margins[2]-display.logo.width; 
     
    119119 
    120120        /** Receive resizing requests **/ 
    121         private function resizeHandler(evt:ControllerEvent=null) { 
     121        private function resizeHandler(evt:ControllerEvent=null):void { 
    122122                var wid = view.config['width']; 
    123123                var hei = view.config['height']; 
     
    146146 
    147147        /** Set a specific icon in the display. **/ 
    148         private function setIcon(icn:String=undefined) { 
     148        private function setIcon(icn:String=undefined):void { 
    149149                for(var i in ICONS) { 
    150150                        if(display[ICONS[i]]) {  
     
    160160 
    161161        /** Setup the logo loading. **/ 
    162         private function setLogo() { 
     162        private function setLogo():void { 
    163163                margins = new Array( 
    164164                        display.logo.x, 
     
    175175 
    176176        /** Handle a change in playback state. **/ 
    177         private function stateHandler(evt:ModelEvent=null) { 
     177        private function stateHandler(evt:ModelEvent=null):void { 
    178178                state = view.config['state']; 
    179179                if(state == ModelStates.PLAYING) { 
  • trunk/as3/com/jeroenwijering/plugins/Playlist.as

    r56 r57  
    4545 
    4646 
    47         public function Playlist() {}; 
     47        public function Playlist():void {}; 
    4848 
    4949 
    5050        /** Initialize the communication with the player. **/ 
    51         public function initializePlugin(vie:AbstractView) { 
     51        public function initializePlugin(vie:AbstractView):void { 
    5252                view = vie; 
    5353                view.addControllerListener(ControllerEvent.ITEM,itemHandler); 
     
    7878 
    7979        /** Setup all buttons in the playlist **/ 
    80         private function buildList(clr:Boolean) { 
     80        private function buildList(clr:Boolean):void { 
    8181                if(!view.playlist) { return; } 
    8282                var wid = clip.back.width; 
     
    118118 
    119119        /** Setup the scrollbar component **/ 
    120         private function buildSlider() { 
     120        private function buildSlider():void { 
    121121                var scr = clip.slider; 
    122122                scr.visible = true; 
     
    130130 
    131131        /** Handle a click on a button. **/ 
    132         private function clickHandler(evt:MouseEvent) { 
     132        private function clickHandler(evt:MouseEvent):void { 
    133133                view.sendEvent('item',Number(evt.target.name)); 
    134134        }; 
     
    136136 
    137137        /** Switch the currently active item */ 
    138         private function itemHandler(evt:ControllerEvent) { 
     138        private function itemHandler(evt:ControllerEvent):void { 
    139139                var idx = view.config['item']; 
    140140                if(buttons[idx]) { 
     
    156156 
    157157        /** Loading of image completed; resume loading **/ 
    158         private function loaderHandler(evt:Event) { 
     158        private function loaderHandler(evt:Event):void { 
    159159                var ldr = Loader(evt.target.loader); 
    160160                Stretcher.stretch(ldr,image[0],image[1],Stretcher.EXACTFIT); 
     
    163163 
    164164        /** Handle a button rollover. **/ 
    165         private function overHandler(evt:MouseEvent) { 
     165        private function overHandler(evt:MouseEvent):void { 
    166166                var idx = Number(evt.target.name); 
    167167                if(light) {  
     
    178178 
    179179        /** Handle a button rollover. **/ 
    180         private function outHandler(evt:MouseEvent) { 
     180        private function outHandler(evt:MouseEvent):void { 
    181181                var idx = Number(evt.target.name); 
    182182                if(front) { 
     
    195195 
    196196        /** New playlist loaded: rebuild the playclip. **/ 
    197         private function playlistHandler(evt:ControllerEvent) { 
     197        private function playlistHandler(evt:ControllerEvent):void { 
    198198                active = undefined; 
    199199                if(view.config['playlist'] != 'none') { 
     
    204204 
    205205        /** Process resizing requests **/ 
    206         private function resizeHandler(evt:ControllerEvent) { 
     206        private function resizeHandler(evt:ControllerEvent):void { 
    207207                if(view.config['playlist'] == 'right') { 
    208208                        clip.x = evt.data.width; 
     
    232232 
    233233        /** Make sure the playlist is not out of range. **/ 
    234         private function scrollCheck() { 
     234        private function scrollCheck():void { 
    235235                var scr = clip.slider; 
    236236                if(clip.list.y > 0 || scr.icon.y < scr.rail.y) { 
     
    246246 
    247247        /** Scrolling handler. **/ 
    248         private function scrollHandler() { 
     248        private function scrollHandler():void { 
    249249                var scr = clip.slider; 
    250250                var yps = scr.mouseY; 
     
    258258 
    259259        /** Init the colors. **/ 
    260         private function setColors() { 
     260        private function setColors():void { 
    261261                if(view.config['backcolor']) {  
    262262                        back = new ColorTransform(); 
     
    280280 
    281281        /** Setup button elements **/ 
    282         private function setContents(idx:Number) { 
     282        private function setContents(idx:Number):void { 
    283283                for (var itm in view.playlist[idx]) { 
    284284                        if(!buttons[idx].c[itm]) { 
     
    323323 
    324324        /** Start scrolling the playlist on mousedown. **/ 
    325         private function sdownHandler(evt:MouseEvent) { 
     325        private function sdownHandler(evt:MouseEvent):void { 
    326326                clearInterval(scrollInterval); 
    327327        clip.stage.addEventListener(MouseEvent.MOUSE_UP,supHandler); 
     
    332332 
    333333        /** Revert the highlight on mouseout. **/ 
    334         private function soutHandler(evt:MouseEvent) { 
     334        private function soutHandler(evt:MouseEvent):void { 
    335335                if(front) { 
    336336                        clip.slider.icon.transform.colorTransform = front; 
     
    342342 
    343343        /** Highlight the icon on rollover. **/ 
    344         private function soverHandler(evt:MouseEvent) { 
     344        private function soverHandler(evt:MouseEvent):void { 
    345345                if(light) { 
    346346                        clip.slider.icon.transform.colorTransform = light; 
     
    352352 
    353353        /** Stop scrolling the playlist on mouseout. **/ 
    354         private function supHandler(evt:MouseEvent) { 
     354        private function supHandler(evt:MouseEvent):void { 
    355355                clearInterval(scrollInterval); 
    356356        clip.stage.removeEventListener(MouseEvent.MOUSE_UP,supHandler); 
     
    359359 
    360360        /** Process state changes **/ 
    361         private function stateHandler(evt:ModelEvent) { 
     361        private function stateHandler(evt:ModelEvent):void { 
    362362                if(view.config['playlist'] == 'over') { 
    363363                        if(evt.data.newstate == ModelStates.PLAYING ||  
     
    372372 
    373373        /** Process mousewheel usage. **/ 
    374         private function wheelHandler(evt:MouseEvent) {}; 
     374        private function wheelHandler(evt:MouseEvent):void {}; 
    375375 
    376376 
  • trunk/as3/com/jeroenwijering/utils/Animations.as

    r54 r57  
    2121        * @param spd    The amount of alpha change per frame. 
    2222        **/ 
    23         public static function fade(tgt:MovieClip,end:Number=1,spd:Number=0.2) { 
     23        public static function fade(tgt:MovieClip,end:Number=1,spd:Number=0.2):void { 
    2424                if(tgt.alpha > end) { 
    2525                        tgt.spd = -Math.abs(spd); 
     
    3333 
    3434        /** The fade enterframe function. **/ 
    35         private static function fadeHandler(evt:Event) { 
     35        private static function fadeHandler(evt:Event):void { 
    3636                var tgt = MovieClip(evt.target); 
    3737                if((tgt.alpha >= tgt.end-tgt.spd && tgt.spd > 0) || 
     
    5555        * @param spd    The movement speed (1 - 2). 
    5656        **/ 
    57         public static function ease(tgt:MovieClip,xps:Number,yps:Number,spd:Number=2) { 
     57        public static function ease(tgt:MovieClip,xps:Number,yps:Number,spd:Number=2):void { 
    5858                if(!xps) { tgt.xps = tgt.x; } else { tgt.xps = xps; } 
    5959                if(!yps) { tgt.yps = tgt.y; } else { tgt.yps = yps; } 
     
    6464 
    6565        /** The ease enterframe function. **/ 
    66         private static function easeHandler(evt:Event) { 
     66        private static function easeHandler(evt:Event):void { 
    6767                var tgt = MovieClip(evt.target); 
    6868                if(Math.abs(tgt.x - tgt.xps) < 1 && Math.abs(tgt.y - tgt.yps) < 1) { 
     
    8484        * @param spd    The speed of typing (1 - 2). 
    8585        **/ 
    86         public static function write(tgt:MovieClip,str:String,spd:Number=1.5) { 
     86        public static function write(tgt:MovieClip,str:String,spd:Number=1.5):void { 
    8787                tgt.str = str; 
    8888                tgt.spd = spd; 
     
    9393 
    9494        /** The write enterframe function. **/ 
    95         private static function writeHandler(evt:Event) { 
     95        private static function writeHandler(evt:Event):void { 
    9696                var tgt = MovieClip(evt.target); 
    9797                var dif = Math.floor((tgt.str.length-tgt.tf.text.length)/tgt.spd); 
  • trunk/as3/com/jeroenwijering/utils/Configger.as

    r49 r57  
    2626 
    2727        /** Constructor; nothing fancy. **/ 
    28         public function Configger(ref:Sprite) { 
     28        public function Configger(ref:Sprite):void { 
    2929                reference = ref; 
    3030        }; 
     
    3636        * @param def    The config object to overwrite new data in. 
    3737        **/ 
    38         public function load(def:Object) { 
     38        public function load(def:Object):void { 
    3939                config = def; 
    4040                var xml = reference.root.loaderInfo.parameters['config']; 
     
    4848 
    4949        /** Load configuration data from external XML file. **/ 
    50         private function loadXML(url:String) { 
     50        private function loadXML(url:String):void { 
    5151                loader = new URLLoader(); 
    5252                loader.addEventListener(Event.COMPLETE,xmlHandler); 
     
    5858 
    5959        /** Parse the XML list **/ 
    60         private function xmlHandler(evt:Event) { 
     60        private function xmlHandler(evt:Event):void { 
    6161                var dat = XML(evt.currentTarget.data); 
    6262                var obj = new Object(); 
     
    7070 
    7171        /** Set config variables or load them from flashvars. **/ 
    72         private function loadFlashvars() { 
     72        private function loadFlashvars():void { 
    7373                compareWrite(reference.root.loaderInfo.parameters); 
    7474                dispatchEvent(new Event(Event.COMPLETE)); 
     
    7777 
    7878        /** Compare and save new items in config, preserving datatype. **/ 
    79         private function compareWrite(obj:Object) { 
     79        private function compareWrite(obj:Object):void { 
    8080                for(var cfv in obj) { 
    8181                        var lfv = cfv.toLowerCase(); 
  • trunk/as3/com/jeroenwijering/utils/Draw.as

    r48 r57  
    1919        * @param tgt    Displayobject to clear. 
    2020        **/ 
    21         public static function clear(tgt:Sprite) { 
     21        public static function clear(tgt:Sprite):void { 
    2222                var len = tgt.numChildren; 
    2323                for(var i=0; i<len; i++) { 
  • trunk/as3/com/jeroenwijering/utils/NetClient.as

    r54 r57  
    1313 
    1414        /** Constructor. **/ 
    15         public function NetClient(cbk:Object) { 
     15        public function NetClient(cbk:Object):void { 
    1616                callback = cbk; 
    1717        }; 
     
    1919 
    2020        /** Forward calls to callback **/ 
    21         private function forward(dat:Object) { 
     21        private function forward(dat:Object):void { 
    2222                callback.onData(dat); 
    2323        }; 
     
    2525 
    2626        /** Handler for captionate events. **/ 
    27         public function onBWDone() { 
     27        public function onBWDone():void { 
    2828                var dat = {type:'bwdone'}; 
    2929                forward(dat); 
     
    3232 
    3333        /** Handler for captionate events. **/ 
    34         public function onCaption(cps:String,spk:Number) { 
     34        public function onCaption(cps:String,spk:Number):void { 
    3535                var dat = {type:'caption',captions:cps,speaker:spk}; 
    3636                forward(dat); 
     
    3939 
    4040        /** Handler for captionate events. **/ 
    41         public function onCaptionInfo(obj:Object) { 
     41        public function onCaptionInfo(obj:Object):void { 
    4242                var dat = {type:'captioninfo'}; 
    4343                for(var i in obj) { dat[i] = obj[i]; } 
     
    4747 
    4848        /** Handler for captionate events. **/ 
    49         public function onCuePoint(obj:Object) { 
     49        public function onCuePoint(obj:Object):void { 
    5050                var dat = {type:'cuepoint'}; 
    5151                for(var i in obj) { dat[i] = obj[i]; } 
     
    5555 
    5656        /** Some Limelight crap. **/ 
    57         public function onFCSubscribe(obj:Object) { 
     57        public function onFCSubscribe(obj:Object):void { 
    5858                var dat = {type:'fcsubscribe'}; 
    5959                for(var i in obj) { dat[i] = obj[i]; } 
     
    6363 
    6464        /** Get image data from netstream. **/ 
    65         public function onImageData(obj:Object) { 
     65        public function onImageData(obj:Object):void { 
    6666                var dat = {type:'imagedata'}; 
    6767                forward(obj); 
     
    7070 
    7171        /** Handler for LaasstSecond call. **/ 
    72         public function onLastSecond(obj:Object) { 
     72        public function onLastSecond(obj:Object):void { 
    7373                var dat = {type:'lastsecond'}; 
    7474                forward(dat); 
     
    7777 
    7878        /** Get metadata information from netstream class. **/ 
    79         public function onMetaData(obj:Object) { 
     79        public function onMetaData(obj:Object):void { 
    8080                var dat = {type:'metadata'}; 
    8181                for(var i in obj) { dat[i] = obj[i]; } 
     
    8989 
    9090        /** Receive NetStream playback codes. **/ 
    91         public function onPlayStatus(dat:Object) { 
     91        public function onPlayStatus(dat:Object):void { 
    9292                if(dat.code == "NetStream.Play.Complete") { 
    9393                        var dat = {type:'complete'}; 
     
    9898 
    9999        /** RTMP Sample callback. **/ 
    100         public function RtmpSampleAccess(obj:Object) { 
     100        public function RtmpSampleAccess(obj:Object):void { 
    101101                var dat = {type:'rtmpsampleaccess'}; 
    102102                forward(dat); 
     
    105105 
    106106        /** Get textdata from netstream. **/ 
    107         public function onTextData(obj:Object) { 
     107        public function onTextData(obj:Object):void { 
    108108                var dat = {type:'textdata'}; 
    109109                for(var i in obj) { dat[i] = obj[i]; } 
  • trunk/as3/com/jeroenwijering/utils/Playlister.as

    r54 r57  
    2323 
    2424        /** Constructor. **/ 
    25         public function Playlister() { 
     25        public function Playlister():void { 
    2626                loader = new URLLoader(); 
    2727                loader.addEventListener(Event.COMPLETE,loaderHandler); 
     
    3333 
    3434        /** Determine filetype and load file or list. **/ 
    35         public function load(obj:Object) { 
     35        public function load(obj:Object):void { 
    3636                if(typeof(obj) == 'string') { 
    3737                        var obj = {file:obj}; 
     
    6565 
    6666        /** Catch security and io errors **/ 
    67         private function errorHandler(evt:ErrorEvent) { 
     67        private function errorHandler(evt:ErrorEvent):void { 
    6868                dispatchEvent(new ErrorEvent(ErrorEvent.ERROR,false,false,status+': '+evt.text)); 
    6969        }; 
     
    7171 
    7272        /** Translate the XML object to the feed array. **/ 
    73         private function loaderHandler(evt:Event) { 
     73        private function loaderHandler(evt:Event):void { 
    7474                try { 
    7575                        var dat = XML(evt.target.data); 
     
    106106 
    107107        /** Save the http status **/ 
    108         private function statusHandler(evt:HTTPStatusEvent) { 
     108        private function statusHandler(evt:HTTPStatusEvent):void { 
    109109                status = evt.status; 
    110110        }; 
     
    118118 
    119119        /** Handler for manually updating elements. **/ 
    120         public function update(itm:Number,elm:String,val:Object) { 
     120        public function update(itm:Number,elm:String,val:Object):void { 
    121121                if(_playlist[itm]) { 
    122122                        _playlist[itm][elm] = val; 
  • trunk/as3/com/jeroenwijering/utils/Randomizer.as

    r1 r57  
    2121        * @param len    Length of the list to randomize. 
    2222        **/ 
    23         public function Randomizer(len:Number) { 
     23        public function Randomizer(len:Number):void { 
    2424                original = new Array(); 
    2525                todo = new Array(); 
  • trunk/as3/com/jeroenwijering/utils/Stacker.as

    r52 r57  
    2828        * @param skn    The MovieClip to manage stacking of. 
    2929        **/ 
    30         public function Stacker(clp:MovieClip) { 
     30        public function Stacker(clp:MovieClip):void { 
    3131                clip = clp; 
    3232                analyze(); 
     
    3535 
    3636        /** Analyze the MovieClip and save its children.  **/ 
    37         private function analyze() { 
     37        private function analyze():void { 
    3838                _width = clip.width; 
    3939                stack = new Array(); 
     
    5353                        if(i!=idx && stack[i].c.visible==true && stack[i].w < _width && 
    5454                                stack[i].x < max && stack[i].x+stack[i].w > min) { 
    55                                 // trace(stack[idx].n+'overlaps with'+stack[i].n); 
    56                                 // trace(stack[i].x+'-'+max+' / '+(stack[i].x+stack[i].w)+'-'+min); 
     55                                //trace(stack[idx].n+' overlaps with '+stack[i].n); 
     56                                //trace(stack[i].x+'-'+max+' / '+(stack[i].x+stack[i].w)+'-'+min); 
    5757                                return true; 
    5858                        } 
     
    6767        * @param wid    The target width of the clip. 
    6868        **/ 
    69         public function rearrange(wid:Number=undefined) {  
     69        public function rearrange(wid:Number=undefined):void { 
    7070                if(wid) { latest = wid; } 
    7171                var rdf = latest-width; 
     
    7575                        if(stack[i].x > width/2) { 
    7676                                stack[i].c.x = stack[i].x + rdf; 
     77                                //trace(stack[i].n+': docked right'); 
    7778                                if(stack[i].c.visible == false && overlaps(i) == false) { 
    7879                                        rdf -= stack[i+1].x - stack[i].x; 
     
    8081                        } else { 
    8182                                stack[i].c.x = stack[i].x-ldf; 
     83                                //trace(stack[i].n+': docked left'); 
    8284                                if(stack[i].c.visible == false && overlaps(i) == false) { 
    8385                                        if(stack[i-1].w > width/3) { 
     
    8991                        } 
    9092                        if(stack[i].w > width/3) { 
     93                                //trace(stack[i].n+': stretched'); 
    9194                                stack[i].c.width = stack[i].w+rdf+ldf; 
    9295                        } 
     
    99102                                        stack[j].c.x += dif; 
    100103                                } 
    101                                 if(stack[j].w>width/4 && stack[j].w<width) { 
     104                                if(stack[j].w > width/3 && stack[j].w < width) { 
    102105                                        stack[j].c.width += dif; 
    103106                                } 
  • trunk/as3/com/jeroenwijering/utils/Stretcher.as

    r1 r57  
    2929        * @param typ    The stretching type. 
    3030        **/ 
    31         public static function stretch(clp:DisplayObject,wid:Number,hei:Number,typ:String='uniform') { 
     31        public static function stretch(clp:DisplayObject,wid:Number,hei:Number,typ:String='uniform'):void { 
    3232                var xsc = wid/clp.width; 
    3333                var ysc = hei/clp.height; 
  • trunk/as3/com/jeroenwijering/utils/TEA.as

    r52 r57  
    99* See http://www.movable-type.co.uk/scripts/TEAblock.html 
    1010* 
    11 * Took the liberty of renaming this so all JW Player utils are in one package.. 
     11* JW took the liberty of renaming this so all JW Player utils are in one package.. 
    1212*/ 
    1313package com.jeroenwijering.utils { 
Note: See TracChangeset for help on using the changeset viewer.