Select to view content in your preferred language

Scale Bar, resize and low resolution screen

678
2
12-06-2012 07:47 AM
ionarawilson1
Deactivated User
I am trying to move the scale bar up when the screen resolution is small, so I created a resize event for the application but I get errors when I try to set the style. I know I am pretty close to a solution.Does anybody know how to set the style for a scale bar using actioscript? Thanks


   protected function application1_resizeHandler(event:ResizeEvent):void
   {
    if(this.scaleX > 1){
     //check if we need to readjust to a normal scale of 1
     var effectiveWidth:int = this.width*this.scaleX;
     var effectiveHeight:int = this.height*this.scaleY;
     if(effectiveWidth > 1280 || effectiveHeight > 1024){
  
     }
    }else{
     //the scale is still 1, lets see if we should scale it up
     if(this.width < 1280 || this.height < 1024){
     
     styledscalebar.getStyle("bottom", 150);
   
     
     }
    }
    
   }
Tags (2)
0 Kudos
2 Replies
BjornSvensson
Esri Regular Contributor
I am trying to move the scale bar up when the screen resolution is small


You shouldn't have to do any of that.  The scalebar is automatically moved up (since it's placement is based on the bottom of the map).  Test for example by resizing the browser for a basic map like http://resources.arcgis.com/en/help/flex-api/samples/01nq/WorldImageryMap.swf.  You can resize that window to as small as you want and you will still see the scalebar and the logo.

As I hinted on in your other post, http://forums.arcgis.com/threads/72876-Application-scale-bar-and-screen-resolubtion?p=254574&viewful..., I still think that there is something related with your specific application 🙂
0 Kudos
ionarawilson1
Deactivated User
Hi Bjorn,

I think you might be right. Although my application does not have a height the map panel does, and even though it is in %, it is causing this problem. But I think I will just move the scale to the top right as it would be difficult to change the design now. I will keep this in mind for a new application! Thank you!
0 Kudos