Changeset 37

Show
Ignore:
Timestamp:
02/24/08 23:31:30 (11 months ago)
Author:
brent
Message:

just change code indentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • worldkit/com/brainoff/W3CDateTime.as

    r35 r37  
    11/* 
    2        W3CDateTime.as 
    3          
    4        Mike Chambers 
    5        mesh@macromedia.com 
    6          
    7        Represents a date in the W3CDateTime format as described in 
    8  
    9        http://www.w3.org/TR/NOTE-datetime 
    10          
    11        version .60 
    12          
    13        Known Issues: 
    14                -The class does not support decimal seconds. Any decimal seconds 
    15                        specificed in a W3CDateTime string will be lost / removed. 
    16          
    17        TODO: 
    18                -Look at optimize parsing code 
    19                -Extensive Testing 
    20                -Look into supporting decimal seconds 
    21                  
    22        Thanks to: 
    23                Tatsuo Kato, Peter Hall and Gary Grossman for help with determining the 
    24                UTC offsets. 
    25 */ 
     2   W3CDateTime.as 
     3 
     4   Mike Chambers 
     5   mesh@macromedia.com 
     6 
     7   Represents a date in the W3CDateTime format as described in 
     8 
     9http://www.w3.org/TR/NOTE-datetime 
     10 
     11version .60 
     12 
     13Known Issues: 
     14-The class does not support decimal seconds. Any decimal seconds 
     15specificed in a W3CDateTime string will be lost / removed. 
     16 
     17TODO: 
     18-Look at optimize parsing code 
     19-Extensive Testing 
     20-Look into supporting decimal seconds 
     21 
     22Thanks to: 
     23Tatsuo Kato, Peter Hall and Gary Grossman for help with determining the 
     24UTC offsets. 
     25 */ 
    2626 
    2727/*Extends the Date object*/ 
     
    2929{ 
    3030 
    31        /* 
    32                Constructor. Optionally takes a WC3DateTime string that the instance 
    33                will represent. 
    34                  
    35                Otherwise, it represents the time that the instance was created. 
    36        */ 
     31    /* 
     32       Constructor. Optionally takes a WC3DateTime string that the instance 
     33       will represent. 
     34 
     35       Otherwise, it represents the time that the instance was created. 
     36     */ 
    3737    public function W3CDateTime(dateString:String) 
    3838    { 
     
    4242        } 
    4343    } 
    44      
    45        /* 
    46                Takes a W3CDateTime formatted string and sets the instance to represent 
    47                the date and time represented in that string 
    48        */ 
     44 
     45    /* 
     46       Takes a W3CDateTime formatted string and sets the instance to represent 
     47       the date and time represented in that string 
     48     */ 
    4949    public function setDateTimeString(dateString:String):Void 
    5050    { 
    51             //this.dateString = dateString; 
    52              setTime(W3CDateTime.parseString(dateString).getTime());           
    53     } 
    54      
    55        /* 
    56                Returns a W3CDateTime formatted string that represents the date represented 
    57                by the current instance. 
    58                  
    59                Takes 4 optional arguments which specifies the format of the string: 
    60                  
    61                incMonth : Whether the month should be included. 
    62                          
    63                incDay : Whether the day of the month should be included.  
    64                          
    65                incHours : Whether the hours and minutes should be included. 
    66                  
    67                incSeconds : Whether the seconds should be included. 
    68                  
    69                Note, that all output will be a valid W3CDataTime item. 
    70        */ 
     51        //this.dateString = dateString; 
     52        setTime(W3CDateTime.parseString(dateString).getTime());                
     53    } 
     54 
     55    /* 
     56       Returns a W3CDateTime formatted string that represents the date represented 
     57       by the current instance. 
     58 
     59       Takes 4 optional arguments which specifies the format of the string: 
     60 
     61incMonth : Whether the month should be included. 
     62 
     63incDay : Whether the day of the month should be included.  
     64 
     65incHours : Whether the hours and minutes should be included. 
     66 
     67incSeconds : Whether the seconds should be included. 
     68 
     69Note, that all output will be a valid W3CDataTime item. 
     70     */ 
    7171    public function getDateTimeString(incMonth:Boolean, 
    72                                                                                incDay:Boolean, 
    73                                                                                incHours:Boolean, 
    74                                                                                incSeconds:Boolean):String 
    75     { 
    76                return W3CDateTime.parseDate(this, incMonth, incDay, incHours, incSeconds); 
     72            incDay:Boolean, 
     73            incHours:Boolean, 
     74            incSeconds:Boolean):String 
     75    { 
     76        return W3CDateTime.parseDate(this, incMonth, incDay, incHours, incSeconds); 
    7777    }     
    78      
    79        /* 
    80                Returns the full W3CDateTime string represented by the instance. 
    81        */ 
     78 
     79    /* 
     80       Returns the full W3CDateTime string represented by the instance. 
     81     */ 
    8282    public function toString(Void):String 
    8383    { 
    84                return getDateTimeString(true, true, true, true);               
    85     }    
    86          
    87        /* 
    88                Returns the Year the W3CDateTime represents in the following format: 
    89                YYYY 
    90        */ 
    91        public function getW3CYear(Void):String 
    92        
    93                return getFullYear().toString(); 
    94        
    95  
    96        /* 
    97                Returns the Month the W3CDateTime represents in the following format: 
    98                MM 
    99                  
    100                where 1 = January 
    101        */ 
    102        public function getW3CMonth(Void):String 
    103        
    104                return (getMonth() + 1).toString(); 
    105        
    106  
    107        /* 
    108                Returns the day of the month the W3CDateTime represents in the 
    109                following format: 
    110                dd 
    111        */      
    112        public function getW3CDate(Void):String 
    113        
    114                return getDate().toString(); 
    115        
    116  
    117        /* 
    118                Returns the hour the W3CDateTime represents in the 
    119                following format: 
    120                hh              
    121        */ 
    122        public function getW3CHours(Void):String 
    123        
    124                //adjust for utc? 
    125                return getHours().toString(); 
    126        }       
    127  
    128        /* 
    129                Returns the minutes the W3CDateTime represents in the 
    130                following format: 
    131                mm              
    132        */      
    133        public function getW3CMinutes(Void):String 
    134        
    135                return getMinutes().toString(); 
    136        }       
    137  
    138        /* 
    139                Returns the seconds the W3CDateTime represents in the 
    140                following format: 
    141                ss              
    142        */      
    143        public function getW3CSeconds(Void):String 
    144        
    145                return getMinutes().toString(); 
    146        }       
    147          
    148        /* 
    149                Returns the UTC offset the W3CDateTime represents in the 
    150                following format: 
    151                +/-hh:mm 
    152  
    153                Note, if there is no offset, it will return 
    154                Z               
    155        */      
    156        public function getW3CUTCOffset(Void):String 
    157        
    158                return W3CDateTime.formatTimezoneOffset(this); 
    159        }       
    160          
    161        /* 
    162                Static functions that takes a String representation of a number and adds 
    163                a leading 0 if it is a single digit. 
    164        */ 
    165        public static function padDigit(digit:String):String 
    166        
    167                if(digit.length < 2) 
    168                
    169                        return "0" + digit; 
    170                
    171                  
    172                return digit; 
    173        
    174          
    175        /* 
    176                Static function that takes an ActionScript Date object and returns 
    177                a well formed W3CDateTime String that represents the specified date. 
    178                  
    179                Takes 4 additional optional arguments which specifies the format of 
    180                the string: 
    181                  
    182                incMonth : Whether the month should be included. 
    183                          
    184                incDay : Whether the day of the month should be included.  
    185                          
    186                incHours : Whether the hours and minutes should be included. 
    187                  
    188                incSeconds : Whether the seconds should be included. 
    189                  
    190                Note, that all output will be a valid W3CDataTime item.                 
    191        */ 
    192        public static function parseDate(inDate:Date,  
    193                                                                                incMonth:Boolean, 
    194                                                                                incDay:Boolean, 
    195                                                                                incHours:Boolean, 
    196                                                                                incSeconds:Boolean):String 
    197        
    198                if(inDate == undefined) 
    199                
    200                        return undefined; 
    201                
    202                  
    203                if(incMonth == undefined) 
    204                
    205                        incMonth = false; 
    206                
    207                  
    208                if(incDay == undefined) 
    209                
    210                        incDay = false; 
    211                
    212                  
    213                if(incHours == undefined) 
    214                
    215                        incHours = false; 
    216                }               
    217                  
    218                if(incSeconds == undefined) 
    219                
    220                        incSeconds = false; 
    221                }               
    222                  
    223                var now:Date = new Date(); 
    224                  
    225                var w3cString:String = now.getFullYear().toString(); 
    226                  
    227                if(!incMonth) 
    228                
    229                        return w3cString; 
    230                
    231                  
    232                w3cString += "-" + W3CDateTime.padDigit((now.getMonth() + 1).toString()); 
    233                  
    234                if(!incDay) 
    235                
    236                        return w3cString;                       
    237                
    238                  
    239                w3cString += "-" + W3CDateTime.padDigit(now.getDate().toString()); 
    240          
    241                if(!incHours) 
    242                
    243                        return w3cString;                       
    244                
    245                  
    246                w3cString += "T" + W3CDateTime.padDigit(now.getHours().toString()) + 
    247                                                        ":" + W3CDateTime.padDigit(now.getMinutes().toString());                
    248          
    249                if(!incSeconds) 
    250                
    251                        //need to format the timeset appropriately 
    252                        return w3cString + W3CDateTime.formatTimezoneOffset(now);                       
    253                
    254                  
    255                return w3cString + ":" + W3CDateTime.padDigit(now.getSeconds().toString()) + 
    256                                                                W3CDateTime.formatTimezoneOffset(now); 
    257        
    258          
    259        /* 
    260                Static methods that takes an ActionScript date instance, and returns 
    261                the UTC offset in the format used in a W3CDateTime string. 
    262                  
    263                The format is: 
    264                  
    265                +/-hh:mm 
    266                  
    267                If the offset is 0, then method will return 
    268                
    269        */ 
    270        public static function formatTimezoneOffset(d:Date):String 
    271        
    272                var timezoneOffset:Number = d.getTimezoneOffset(); 
    273                  
    274                if(timezoneOffset == 0) 
    275                
    276                        return "Z"; 
    277                
    278                  
    279                var operator:String = (timezoneOffset > -1)? "+" : "-"; 
    280                  
    281                if(timezoneOffset < 0) 
    282                
    283                        timezoneOffset *= -1; 
    284                
    285                  
    286                //what if offset if 0 or less 
    287                var hours_i:Number = (timezoneOffset / 60); 
    288                var seconds:String = (timezoneOffset - (hours_i * 60)).toString(); 
    289                  
    290                return operator + W3CDateTime.padDigit(hours_i.toString()) + 
    291                                                        ":" + W3CDateTime.padDigit(seconds); 
    292        
    293          
    294        /* 
    295                Static method that takes a W3CDateTime string and returns an 
    296                ActionScript Date object that represents the string passed in. 
    297        */ 
     84        return getDateTimeString(true, true, true, true);              
     85    }    
     86 
     87    /* 
     88       Returns the Year the W3CDateTime represents in the following format: 
     89       YYYY 
     90     */ 
     91    public function getW3CYear(Void):String 
     92   
     93        return getFullYear().toString(); 
     94   
     95 
     96    /* 
     97       Returns the Month the W3CDateTime represents in the following format: 
     98       MM 
     99 
     100       where 1 = January 
     101     */ 
     102    public function getW3CMonth(Void):String 
     103   
     104        return (getMonth() + 1).toString(); 
     105   
     106 
     107    /* 
     108       Returns the day of the month the W3CDateTime represents in the 
     109       following format: 
     110       dd 
     111     */        
     112    public function getW3CDate(Void):String 
     113   
     114        return getDate().toString(); 
     115   
     116 
     117    /* 
     118       Returns the hour the W3CDateTime represents in the 
     119       following format: 
     120       hh              
     121     */ 
     122    public function getW3CHours(Void):String 
     123   
     124        //adjust for utc? 
     125        return getHours().toString(); 
     126    }  
     127 
     128    /* 
     129       Returns the minutes the W3CDateTime represents in the 
     130       following format: 
     131       mm              
     132     */        
     133    public function getW3CMinutes(Void):String 
     134   
     135        return getMinutes().toString(); 
     136    }  
     137 
     138    /* 
     139       Returns the seconds the W3CDateTime represents in the 
     140       following format: 
     141       ss              
     142     */        
     143    public function getW3CSeconds(Void):String 
     144   
     145        return getMinutes().toString(); 
     146    }  
     147 
     148    /* 
     149       Returns the UTC offset the W3CDateTime represents in the 
     150       following format: 
     151       +/-hh:mm 
     152 
     153       Note, if there is no offset, it will return 
     154       Z               
     155     */        
     156    public function getW3CUTCOffset(Void):String 
     157   
     158        return W3CDateTime.formatTimezoneOffset(this); 
     159    }  
     160 
     161    /* 
     162       Static functions that takes a String representation of a number and adds 
     163       a leading 0 if it is a single digit. 
     164     */ 
     165    public static function padDigit(digit:String):String 
     166   
     167        if(digit.length < 2) 
     168       
     169            return "0" + digit; 
     170       
     171 
     172        return digit; 
     173   
     174 
     175    /* 
     176       Static function that takes an ActionScript Date object and returns 
     177       a well formed W3CDateTime String that represents the specified date. 
     178 
     179       Takes 4 additional optional arguments which specifies the format of 
     180       the string: 
     181 
     182incMonth : Whether the month should be included. 
     183 
     184incDay : Whether the day of the month should be included.  
     185 
     186incHours : Whether the hours and minutes should be included. 
     187 
     188incSeconds : Whether the seconds should be included. 
     189 
     190Note, that all output will be a valid W3CDataTime item.                
     191     */ 
     192    public static function parseDate(inDate:Date,  
     193            incMonth:Boolean, 
     194            incDay:Boolean, 
     195            incHours:Boolean, 
     196            incSeconds:Boolean):String 
     197   
     198        if(inDate == undefined) 
     199       
     200            return undefined; 
     201       
     202 
     203        if(incMonth == undefined) 
     204       
     205            incMonth = false; 
     206       
     207 
     208        if(incDay == undefined) 
     209       
     210            incDay = false; 
     211       
     212 
     213        if(incHours == undefined) 
     214       
     215            incHours = false; 
     216        }              
     217 
     218        if(incSeconds == undefined) 
     219       
     220            incSeconds = false; 
     221        }              
     222 
     223        var now:Date = new Date(); 
     224 
     225        var w3cString:String = now.getFullYear().toString(); 
     226 
     227        if(!incMonth) 
     228       
     229            return w3cString; 
     230       
     231 
     232        w3cString += "-" + W3CDateTime.padDigit((now.getMonth() + 1).toString()); 
     233 
     234        if(!incDay) 
     235       
     236            return w3cString;                  
     237       
     238 
     239        w3cString += "-" + W3CDateTime.padDigit(now.getDate().toString()); 
     240 
     241        if(!incHours) 
     242       
     243            return w3cString;                  
     244       
     245 
     246        w3cString += "T" + W3CDateTime.padDigit(now.getHours().toString()) + 
     247            ":" + W3CDateTime.padDigit(now.getMinutes().toString());           
     248 
     249        if(!incSeconds) 
     250       
     251            //need to format the timeset appropriately 
     252            return w3cString + W3CDateTime.formatTimezoneOffset(now);                  
     253       
     254 
     255        return w3cString + ":" + W3CDateTime.padDigit(now.getSeconds().toString()) + 
     256            W3CDateTime.formatTimezoneOffset(now); 
     257   
     258 
     259    /* 
     260       Static methods that takes an ActionScript date instance, and returns 
     261       the UTC offset in the format used in a W3CDateTime string. 
     262 
     263       The format is: 
     264 
     265       +/-hh:mm 
     266 
     267       If the offset is 0, then method will return 
     268       
     269     */ 
     270    public static function formatTimezoneOffset(d:Date):String 
     271   
     272        var timezoneOffset:Number = d.getTimezoneOffset(); 
     273 
     274        if(timezoneOffset == 0) 
     275       
     276            return "Z"; 
     277       
     278 
     279        var operator:String = (timezoneOffset > -1)? "+" : "-"; 
     280 
     281        if(timezoneOffset < 0) 
     282       
     283            timezoneOffset *= -1; 
     284       
     285 
     286        //what if offset if 0 or less 
     287        var hours_i:Number = (timezoneOffset / 60); 
     288        var seconds:String = (timezoneOffset - (hours_i * 60)).toString(); 
     289 
     290        return operator + W3CDateTime.padDigit(hours_i.toString()) + 
     291            ":" + W3CDateTime.padDigit(seconds); 
     292   
     293 
     294    /* 
     295       Static method that takes a W3CDateTime string and returns an 
     296       ActionScript Date object that represents the string passed in. 
     297     */ 
    298298    public static function parseString(dateString:String):Date 
    299299    { 
    300                if(dateString == undefined || dateString.length < 1) 
    301                
    302                        return undefined; 
    303                
    304                  
    305                var YYYY:String = dateString.substr(0, 4); 
    306                var MM:String = dateString.substr(5, 2); 
    307                var DD:String = dateString.substr(8, 2); 
    308                var hh:String = dateString.substr(11, 2); 
    309                var mm:String = dateString.substr(14, 2); 
    310                var ss:String = dateString.substr(17, 2); 
    311                var s:String = ""; 
    312                  
    313                var offsetOperator:String; 
    314                var offsetHours:String; 
    315                var offsetMinutes:String; 
    316                  
    317                var offset:Number = 0;          
    318                var operator:Number; 
    319                var indexBump:Number = 0; 
    320                  
    321                if(dateString.substr(19, 1) == ".") 
    322                
    323                        //they have a decimal second 
    324                        s = dateString.substr(20, 2); 
    325                          
    326                        indexBump = 3;                  
    327                
    328                else if (ss == "") { //can have tz offset with no seconds 
    329                        indexBump = -2; 
    330                
    331                else 
    332                
    333                        indexBump = 0; 
    334                        //they dont have a decimal second 
    335                
    336                  
    337                offsetOperator = dateString.substr(19 + indexBump,1); 
    338                offsetHours = dateString.substr(20 + indexBump,2); 
    339                offsetMinutes = dateString.substr(23 + indexBump,2); 
    340                  
    341                //this could be wrong if there is no operator 
    342                operator = ((offsetOperator == "-") || (offsetOperator == undefined))? 1 : -1;  
    343                  
    344                //this could be wrong if offsethours or offsetminutes is undefined 
    345                offset = operator * (Number(offsetHours) * 60) + Number(offsetMinutes); 
    346                  
    347                if(isNaN(offset)) 
    348                
    349                        offset = 0; 
    350                
    351                  
    352                var minutes:Number; 
    353                if(mm != "") 
    354                
    355                        minutes = Number(mm) + offset; 
    356                
    357                  
    358                var month:Number; 
    359                if(MM != "") 
    360                
    361                        month = Number(MM) - 1; 
    362                
    363                  
    364                var year:Number; 
    365                if(YYYY != "") 
    366                
    367                        year = Number(YYYY); 
    368                
    369                  
    370                var day:Number; 
    371                if(DD != "") 
    372                {                       
    373                        day = Number(DD); 
    374                
    375                  
    376                var hours:Number; 
    377                if(hh != "") 
    378                
    379                        hours = Number(hh); 
    380                }               
    381  
    382                var seconds:Number; 
    383                if(ss != "") 
    384                
    385                        seconds = Number(ss); 
    386                }       
    387                  
    388                var utcTimeMS = Date.UTC( 
    389                                year, 
    390                                month,  
    391                                day, 
    392                                hours,  
    393                                minutes, 
    394                                seconds); 
    395  
    396                return new Date(utcTimeMS);; 
     300        if(dateString == undefined || dateString.length < 1) 
     301       
     302            return undefined; 
     303       
     304 
     305        var YYYY:String = dateString.substr(0, 4); 
     306        var MM:String = dateString.substr(5, 2); 
     307        var DD:String = dateString.substr(8, 2); 
     308        var hh:String = dateString.substr(11, 2); 
     309        var mm:String = dateString.substr(14, 2); 
     310        var ss:String = dateString.substr(17, 2); 
     311        var s:String = ""; 
     312 
     313        var offsetOperator:String; 
     314        var offsetHours:String; 
     315        var offsetMinutes:String; 
     316 
     317        var offset:Number = 0;                 
     318        var operator:Number; 
     319        var indexBump:Number = 0; 
     320 
     321        if(dateString.substr(19, 1) == ".") 
     322       
     323            //they have a decimal second 
     324            s = dateString.substr(20, 2); 
     325 
     326            indexBump = 3;                     
     327       
     328        else if (ss == "") { //can have tz offset with no seconds 
     329            indexBump = -2; 
     330       
     331        else 
     332       
     333            indexBump = 0; 
     334            //they dont have a decimal second 
     335       
     336 
     337        offsetOperator = dateString.substr(19 + indexBump,1); 
     338        offsetHours = dateString.substr(20 + indexBump,2); 
     339        offsetMinutes = dateString.substr(23 + indexBump,2); 
     340 
     341        //this could be wrong if there is no operator 
     342        operator = ((offsetOperator == "-") || (offsetOperator == undefined))? 1 : -1;  
     343 
     344        //this could be wrong if offsethours or offsetminutes is undefined 
     345        offset = operator * (Number(offsetHours) * 60) + Number(offsetMinutes); 
     346 
     347        if(isNaN(offset)) 
     348       
     349            offset = 0; 
     350       
     351 
     352        var minutes:Number; 
     353        if(mm != "") 
     354       
     355            minutes = Number(mm) + offset; 
     356       
     357 
     358        var month:Number; 
     359        if(MM != "") 
     360       
     361            month = Number(MM) - 1; 
     362       
     363 
     364        var year:Number; 
     365        if(YYYY != "") 
     366       
     367            year = Number(YYYY); 
     368       
     369 
     370        var day:Number; 
     371        if(DD != "") 
     372        {                      
     373            day = Number(DD); 
     374       
     375 
     376        var hours:Number; 
     377        if(hh != "") 
     378       
     379            hours = Number(hh); 
     380        }              
     381 
     382        var seconds:Number; 
     383        if(ss != "") 
     384       
     385            seconds = Number(ss); 
     386        }      
     387 
     388        var utcTimeMS = Date.UTC( 
     389                year, 
     390                month,  
     391                day, 
     392                hours,  
     393                minutes, 
     394                seconds); 
     395 
     396        return new Date(utcTimeMS);; 
    397397    } 
    398398} 
  • worldkit/com/brainoff/worldkitAnnotation.as

    r35 r37  
    6565    public function worldkitAnnotation(main:worldkitMain, mc:MovieClip, depth:Number, title:String, url:String, lat:Number, lon:Number, summary:String, cats:Array, id:String, photo:String, prevlat:Number, prevlon:Number, vector:String, vtype:String, datestring:String, precompile:Boolean, enddate:String, rssicon:String) { 
    6666 
    67        this.main = main; 
    68        this.mc = mc; 
    69          
    70        conf = main.getConfig(); 
    71        rss = main.getRSS(); 
    72        interact = main.getInteract(); 
    73        img = main.getImages(); 
    74  
    75        this.depth = depth; 
    76        this.title = title; 
    77        this.url = url; 
    78        this.lat = lat; 
    79        this.lon = lon; 
    80        this.summary = summary; 
    81        this.cats = cats; 
    82        this.id = id; 
    83        this.photo = photo; 
    84        this.prevlat = prevlat; 
    85        this.prevlon = prevlon; 
    86        this.vector = vector; 
    87        this.vtype = vtype; 
    88        this.datestring = datestring; 
    89        this.date = new Date(worldkitUtil.parseDate(datestring)); 
    90        this.precompile = precompile; 
    91        if (enddate != undefined) { 
    92            this.enddate = new Date(worldkitUtil.parseDate(enddate)); 
    93        }  
    94        this.rssicon = rssicon; 
    95  
    96        present = true; 
    97        activate = false; 
    98      
    99        setparams(); 
    100  
    101        if (this.precompile == undefined) { 
    102            clipname = this.depth + "point"; 
    103            textname = this.depth + "pointtext"; 
    104            mc.createEmptyMovieClip(clipname,this.depth); 
    105        } else { 
    106            clipname = this.title; 
    107            textname = this.title + "text"; 
    108        
    109  
    110        if (this.precompile) { 
    111            colorobj = new Color(mc[ this.clipname ]); 
    112        
    113  
    114        createdate = new Date(); 
    115        curralpha = 100; 
    116        mc[this.clipname].annotation = this; 
     67        this.main = main; 
     68        this.mc = mc; 
     69 
     70        conf = main.getConfig(); 
     71        rss = main.getRSS(); 
     72        interact = main.getInteract(); 
     73        img = main.getImages(); 
     74 
     75        this.depth = depth; 
     76        this.title = title; 
     77        this.url = url; 
     78        this.lat = lat; 
     79        this.lon = lon; 
     80        this.summary = summary; 
     81        this.cats = cats; 
     82        this.id = id; 
     83        this.photo = photo; 
     84        this.prevlat = prevlat; 
     85        this.prevlon = prevlon; 
     86        this.vector = vector; 
     87        this.vtype = vtype; 
     88        this.datestring = datestring; 
     89        this.date = new Date(worldkitUtil.parseDate(datestring)); 
     90        this.precompile = precompile; 
     91        if (enddate != undefined) { 
     92            this.enddate = new Date(worldkitUtil.parseDate(enddate)); 
     93        }  
     94        this.rssicon = rssicon; 
     95 
     96        present = true; 
     97        activate = false; 
     98 
     99        setparams(); 
     100 
     101        if (this.precompile == undefined) { 
     102            clipname = this.depth + "point"; 
     103            textname = this.depth + "pointtext"; 
     104            mc.createEmptyMovieClip(clipname,this.depth); 
     105        } else { 
     106            clipname = this.title; 
     107            textname = this.title + "text"; 
     108       
     109 
     110        if (this.precompile) { 
     111            colorobj = new Color(mc[ this.clipname ]); 
     112       
     113 
     114        createdate = new Date(); 
     115        curralpha = 100; 
     116        mc[this.clipname].annotation = this; 
    117117    } 
    118118 
    119119    public function setparams():Void { 
    120        initialplotcolor = conf.getConfBySubject("initialplotcolor", this.cats); 
    121        restingplotcolor = conf.getConfBySubject("restingplotcolor", this.cats); 
    122        activatecolor = conf.getConfBySubject("activatecolor", this.cats); 
    123        plotsize = conf.getConfBySubject("plotsize", this.cats); 
    124        plotshape = conf.getConfBySubject("plotshape", this.cats); 
    125        icon = conf.getMatchingSubject("icon", this.cats); 
    126        linecolor = conf.getConfBySubject("linecolor", this.cats); 
    127        zoomto = conf.getConfBySubject("zoomto", this.cats); 
    128        linealpha = conf.getConfBySubject("linealpha", this.cats); 
    129        linethickness = conf.getConfBySubject("linethickness", this.cats); 
    130        fillalpha = conf.getConfBySubject("fillalpha", this.cats); 
    131        window = conf.getConfBySubject("window", this.cats); 
    132 
     120        initialplotcolor = conf.getConfBySubject("initialplotcolor", this.cats); 
     121        restingplotcolor = conf.getConfBySubject("restingplotcolor", this.cats); 
     122        activatecolor = conf.getConfBySubject("activatecolor", this.cats); 
     123        plotsize = conf.getConfBySubject("plotsize", this.cats); 
     124        plotshape = conf.getConfBySubject("plotshape", this.cats); 
     125        icon = conf.getMatchingSubject("icon", this.cats); 
     126        linecolor = conf.getConfBySubject("linecolor", this.cats); 
     127        zoomto = conf.getConfBySubject("zoomto", this.cats); 
     128        linealpha = conf.getConfBySubject("linealpha", this.cats); 
     129        linethickness = conf.getConfBySubject("linethickness", this.cats); 
     130        fillalpha = conf.getConfBySubject("fillalpha", this.cats); 
     131        window = conf.getConfBySubject("window", this.cats); 
     132   
    133133    public function plot():Void { 
    134        if  (precompile != true && conf.accuplot != true) { 
    135            /**/ 
    136            //reset scaling for plot 
    137            /**/ 
    138            mc._x = 0; mc._y = 0; mc._xscale = 100; mc._yscale = 100; 
    139        
    140  
    141        if (precompile != true) { 
    142            /**/ 
    143            // Calculate positions 
    144            /**/ 
    145            var a = new Array(); 
    146            a = interact.geo2xy(lat,lon,true); x = a[0]; y = a[1]; 
    147            if (x == undefined || y == undefined) { return; }     
    148            if (conf.track && prevlat != undefined && prevlon != undefined) {  
    149                a = interact.geo2xy(prevlat,prevlon); prevx = a[0]; prevy = a[1];  
    150            } 
    151            mc[clipname]._x = x; mc[clipname]._y = this.y; 
    152  
    153            var rescale = 100/interact.scale;  
    154            scale = rescale; 
    155            if (vector == undefined && precompile != true && conf.accuplot != true) { 
    156                mc[clipname]._xscale = rescale;     
    157                mc[clipname]._yscale = rescale; 
    158            } else if (conf.accuplot == true) { 
    159                scale = 100 * 100 /conf.h; 
    160                mc[clipname]._xscale = scale; 
    161                mc[clipname]._yscale = scale; 
    162            } 
    163        
    164  
    165        jsargs = buildJsArgs(); 
    166  
    167        makeText(); 
    168  
    169        mc[clipname].onRelease = function() { this.annotation.onRelease(); } 
    170        mc[clipname].onRollOver = function() { this.annotation.onRollOver();} 
    171        mc[clipname].onRollOut = function() { this.annotation.onRollOut(); } 
    172  
    173        setVisible(true,conf.textinterval); 
    174        
    175        shape(1); 
    176   
    177        if (initialplotcolor != restingplotcolor) {  
    178