6 Replies Latest reply on Mar 24, 2008 9:59 PM by jedale

    Resizing a flex application

    JaxonRice
      I am trying to write a resize function for my flex application. I have pasted a simple sample below, but when I try to run this application I get the following error:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      This is my application:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" resize="resizeHandler()">
      <mx:Script>
      <![CDATA[
      private function resizeHandler():void {
      t.text = stage.width + " - " + stage.height;
      t.text += "\n" + stage.stageWidth + " - " + stage.stageHeight;
      }
      ]]>
      </mx:Script>
      <mx:Panel x="10" y="10" width="250" height="200" layout="absolute">
      <mx:TextArea id="t" x="0" y="0" text="test"/>
      </mx:Panel>

      </mx:Application>

      Can someone tell me where I am going wrong?

      Thanks in advance