0 Replies Latest reply on Oct 5, 2009 4:19 AM by rdiur

    problem with resize delay

    rdiur

      He veryone. This is probalby easy to answer, but its a newbie question, How do I get rid of the resizing delay along edges of the image when resizing the browser window? If anyone can give me a pointer here, it will really help me along:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"    
      verticalScrollPolicy="off" horizontalScrollPolicy="off"
      width="100%" height="100%"   layout="absolute" resize="{bgResize()}" >

      <mx:Script>
      <![CDATA[
      private var monoslideshow:Object;

      private function bgResize():void
      {
      if (mainImage){
      var ratio:Number = mainImage.width / mainImage.height;
      var snapWidth:Boolean = Application.application.width >= Application.application.height * ratio ? true : false;

      mainImage.width = (snapWidth ? Application.application.width : (Application.application.height * ratio));
      mainImage.height = (snapWidth ? (Application.application.width / ratio) : Application.application.height);
      }

      }
      ]]>
      </mx:Script>
      <mx:Image   horizontalCenter="0"  verticalCenter="0" source="cat.jpg" id="mainImage" />

      </mx:Application>