0 Replies Latest reply on Mar 5, 2010 4:52 AM by Stiofansisland

    iFrame Percent height and width of browser window problems.

    Stiofansisland

      Hi all,

       

      First off im new to actionscript and flex.

       

      I cant get a iframe window to resize to the same size as the browser window, it seems to be layed out funny, can some one please take a look and give me some advice/

       

       

      ###########main script########

      [Bindable]private var popup:PopUp; //PopUp window

       

      //show add page popup

      private function showPopUp(src:String):void

      {

      popup = PopUp(PopUpManager.createPopUp(this,PopUp));

      popup.addEventListener(CloseEvent.CLOSE,nullifyPopup);

      popup.src = src;

      popup.frameWidth = 1000;

      popup.frameHeight = 600;

      popup.windowTitle = "Barra Accommodation ";

      PopUpManager.centerPopUp(popup);

      }

      #############

      ########popup#########

      <?xml version="1.0" encoding="utf-8"?>

      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:controls="Controls.*"

      showCloseButton="true" title="{windowTitle}"

      layout="absolute" width="{frameWidth+20}" height="{frameHeight+38}" close="closeall();"

      move="ifr.moveIFrame()" render="ifr.moveIFrame()" borderColor="#306B94" >

      <mx:Script>

      <![CDATA[

      import mx.managers.PopUpManager;

       

      [Bindable]public var src:String; //the source url

      [Bindable]public var frameWidth:Number; //width of the iframe

      [Bindable]public var frameHeight:Number; //height of the iframe

      [Bindable]public var windowTitle:String; //title of the window

       

      public function closeall():void

      {

      PopUpManager.removePopUp(this);

      ifr.visible = false;

      }

      ]]>

      </mx:Script>

       

      <!-- leave the viewstack here -->

      <mx:ViewStack>

      <controls:iFrame id="ifr" source="{src}" width="{frameWidth}" height="{frameHeight}" />

      </mx:ViewStack>

       

      </mx:TitleWindow>

      #########################
      I would like to be able to set it to a percent of the browser window, but i cant figure out how
      Steven