Changeset 4

Show
Ignore:
Timestamp:
02/18/06 02:58:10 (3 years ago)
Author:
mikel
Message:

zoomify annotation fix; dialog box resize fix; categories fix; icon load fix; timenav play button logic

Files:

Legend:

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

    r2 r4  
    343343    //REVISIT if icon hasn't loaded yet, it won't load here 
    344344    private function loadicon():Void { 
    345         mc[clipname].createEmptyMovieClip("icon",1);  
    346         img.loadicon(mc[clipname]["icon"], "icon" + icon); 
     345        if (mc[clipname]["icon"] == undefined) { 
     346            mc[clipname].createEmptyMovieClip("icon",1); 
     347        }  
     348        if (! img.loadicon(mc[clipname]["icon"], "icon" + icon)) { 
     349            worldkitUtil.setTimeout(this, "loadicon", 1000); 
     350        } 
    347351    } 
    348352 
  • com/brainoff/worldkitConfig.as

    r2 r4  
    251251        if (subname == undefined) {  
    252252            subname = "_default_";  
     253        } else { 
     254            subname = subname.toLowerCase(); 
    253255        } 
    254256 
     
    482484            break; 
    483485 
    484  
    485486        default: 
    486487        }  
  • com/brainoff/worldkitImages.as

    r2 r4  
    153153        var key:String = target_mc._parent._name + ":" + target_mc._name; 
    154154        target_mc.loaded = true; 
    155          
     155 
    156156        if (conf.dontstretchimage) { 
    157157            target_mc.origwidth = conf.w; 
     
    524524    } 
    525525   
    526     public function loadicon(mc:MovieClip, id:String):Void
     526    public function loadicon(mc:MovieClip, id:String):Boolean
    527527        if (imagemc[id].loaded) { 
    528             mc.loadMovie(imagemc[id].url); 
    529             mc._x = - .5 * imagemc[id]._width; 
    530             mc._y = - .5 * imagemc[id]._height; 
     528            var key:String = imagemc._name + ":" + id;     
     529            mc.loadMovie(imglist[key].url); 
     530            mc._x = - .5 * imglist[key]["mc"][id]._width; 
     531            mc._y = - .5 * imglist[key]["mc"][id]._height; 
     532            return true; 
     533        } else { 
     534            return false; 
    531535        } 
    532536    } 
  • com/brainoff/worldkitInteraction.as

    r2 r4  
    2323    private var acceptInput:Boolean; 
    2424    private var keylistener:Object; 
     25    private var timenavplay:Boolean; 
     26 
    2527 
    2628    var centery:Number; 
     
    4244    var maxtime:Date; 
    4345 
     46 
    4447    static private var grabberdepth:Number = 20; 
    4548    static private var zoomboxdepth:Number = 19; 
     
    213216        } else if (String.fromCharCode(Key.getAscii()) == "v") { 
    214217            LoadingDialog("worldkit ver. " + worldkitMain.version, true); 
     218        } else if (String.fromCharCode(Key.getAscii()) == "p") { 
     219            timenavplay = true; 
     220        } else if (String.fromCharCode(Key.getAscii()) == "s") { 
     221            timenavplay = false; 
     222        } else if (String.fromCharCode(Key.getAscii()) == "r") { 
     223            timenavplay = false; 
     224            mc.timenav.scrollbar.setScrollPosition(0); 
    215225        } 
    216226    } 
     
    379389            } 
    380390        } 
     391 
     392        if (timenavplay) { 
     393            var p = mc.timenav.scrollbar.getScrollPosition() + 1; 
     394            if (p <= conf.timenavunit) { 
     395                mc.timenav.scrollbar.setScrollPosition(p); 
     396            } else { 
     397                timenavplay = false; 
     398            } 
     399        } 
    381400    } 
    382401 
     
    506525    public function annotate(x:Number,y:Number):Void { 
    507526        var w, h, xoffset=0, yoffset=0; 
    508         if (ratio > 1) { 
    509             w = 100 * ratio; h = 100; 
    510             xoffset = (w - h) / 2; 
    511         } else { 
    512             h = 100 / ratio; w = 100; 
    513             yoffset = (h - w) / 2; 
     527        if (conf.displaytype == "zoomify") { 
     528            w = conf.w; 
     529            h = conf.h; 
     530        } else { 
     531            if (ratio > 1) { 
     532                w = 100 * ratio; h = 100; 
     533                xoffset = (w - h) / 2; 
     534            } else { 
     535                h = 100 / ratio; w = 100; 
     536                yoffset = (h - w) / 2; 
     537            } 
    514538        } 
    515539        var lon = ((x + xoffset)/w) * (ceast - cwest) + cwest; 
    516540        var lat = cnorth - ((y + yoffset)/h) * (cnorth - csouth); 
     541         
    517542 
    518543        var args = "lat=" + lat + "&long=" + lon + "&zoom=" + scale + "&extent=" + cwest + "," + csouth + "," + ceast + "," + cnorth; 
     
    646671            mc.worldkitLoadingDialog.text.borderColor= 0x000000; 
    647672            componentScaleAndPosition("worldkitLoadingDialog",100,-1); 
    648             mc.worldkitLoadingDialog.text.autosize = "center"; 
     673            mc.worldkitLoadingDialog.text.autoSize = "center"; 
    649674        } 
    650675        if (msg == undefined) { 
    651676            mc.worldkitLoadingDialog._visible = 0; 
    652677        } else { 
    653             var textsize;  
     678            var textsize:Number;  
    654679            if (size == undefined) { textsize = 20; } else { textsize = size; } 
    655             mc.worldkitLoadingDialog.text.htmlText = "<font face=\"Arial\" size=\"" + textsize + "\"><b>" + msg + "</b></font>"; 
     680            mc.worldkitLoadingDialog.text.htmlText = "<font face=\"Arial\" size=\"" + textsize.toString() + "\"><b>" + msg + "</b></font>"; 
    656681            mc.worldkitLoadingDialog._visible = 1; 
    657682        } 
  • com/brainoff/worldkitMain.as

    r1 r4  
    77 
    88class com.brainoff.worldkitMain { 
    9     static var version:String = "3.0"; 
     9    static var version:String = "3.0b-17022006"; 
    1010 
    1111    var conf:worldkitConfig; 
  • com/brainoff/worldkitRSS.as

    r2 r4  
    132132    } 
    133133 
    134     private function parseRss(node:XMLNode):Void { 
     134   private function parseRss(node:XMLNode):Void { 
    135135 
    136136        for (var j = 0; j < node.childNodes.length; j++) { 
     
    301301                            lon = a[b].substr( a[b].indexOf("geo:lon=") + 8); 
    302302                        } else { 
    303                             sub.push(a[b]); 
     303                            sub.push(a[b].toLowerCase()); 
    304304                        } 
    305305                    } else { 
    306                         sub.push(a[b]); 
     306                        sub.push(a[b].toLowerCase()); 
    307307                    } 
    308308                } 
     
    493493    } 
    494494    public function onJSubComm(subj:String):Void { 
     495        subj = subj.toLowerCase(); 
    495496        for (var p in Points) { 
    496497            var point = Points[p];