replace powered by ESRI

5103
70
07-22-2010 02:01 AM
NatashaManzuiga
Occasional Contributor
Hi all I perfectly replaced ESRI logo with this script:
http://forums.esri.com/thread.asp?t=287497&f=2421&c=158#912795
Now how can I replace link to esri.com/flex?

Naty
Tags (2)
0 Kudos
70 Replies
RobertScheitlin__GISP
MVP Emeritus
Naty,

   Try this

private function changeESRILogo(map:Map):void {
    for(var i:int = 0 ; i < map.numChildren ; i++){
     var component:UIComponent = map.getChildAt(i) as UIComponent;
     if(component.className == "StaticLayer"){
      for(var j:int = 0 ; j < component.numChildren ; j++){
       var stComponent:UIComponent = component.getChildAt(j) as UIComponent;
       if(stComponent.className == "Image"){
        var img:Image = stComponent as Image;
        if (img.source.toString().indexOf("logo") > 0){
         img.source = myLogo;
         img.addEventListener(MouseEvent.MOUSE_DOWN ,gotoMyURL,false,1000);
         return;
        }
       }
      }
     }
    }
   }

private function gotoMyURL(evt:Event):void
   {
    var myURL:URLRequest = new URLRequest("http://www.google.com/");
    navigateToURL(myURL);
    evt.stopPropagation();
   }
0 Kudos
NatashaManzuiga
Occasional Contributor
Naty,

   Try this

private function changeESRILogo(map:Map):void {
    for(var i:int = 0 ; i < map.numChildren ; i++){
     var component:UIComponent = map.getChildAt(i) as UIComponent;
     if(component.className == "StaticLayer"){
      for(var j:int = 0 ; j < component.numChildren ; j++){
       var stComponent:UIComponent = component.getChildAt(j) as UIComponent;
       if(stComponent.className == "Image"){
        var img:Image = stComponent as Image;
        if (img.source.toString().indexOf("logo") > 0){
         img.source = myLogo;
         img.addEventListener(MouseEvent.MOUSE_DOWN ,gotoMyURL,false,1000);
         return;
        }
       }
      }
     }
    }
   }

private function gotoMyURL(evt:Event):void
   {
    var myURL:URLRequest = new URLRequest("http://www.google.com/");
    navigateToURL(myURL);
    evt.stopPropagation();
   }

Great Robert!!
I just have the last question for u 🙂 How can I do this?
Thanks Robert
http://forums.arcgis.com/threads/8310-Activate-Graphical-Search-Select-by-Point-%28SearchWidget%29-f...
0 Kudos
deleted-user-rQoEFM5qzbHE
New Contributor II
Where would I put these two functions?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   Depends on what your app is... Are you talking a custom flex api app, Sample Flex Viewer 1.x or FlexViewer 2.0?
0 Kudos
deleted-user-rQoEFM5qzbHE
New Contributor II
Sorry, I am attempting to modify the Flex Viewer 2.0 API.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   In that case this code goes in the MapManager.mxml.
0 Kudos
deleted-user-rQoEFM5qzbHE
New Contributor II
Thanks for the response. And, since I have your attention is this where I would put the code related to clustering? I tried to put that in the ViewerContainer.mxml (I am pretty sure this was wrong, but didn't know where to put it) and it kind of works, but it the layers come up behind the existing services found in the config.xml.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   Not sure which clustering code you are referencing but as clustering is a layer than yes it should go in the MapManager.
0 Kudos
deleted-user-rQoEFM5qzbHE
New Contributor II
It is the code found in the samples section for ArcGIS API for flex. I get an error for the section inside of the Declaration tag. The error says that the 'prefix "text" for element "text:TextFormat" is not bound'. Thanks again for all your help.
0 Kudos