1 Reply Latest reply on Jul 27, 2007 12:18 AM by Yann Martel

    access mx tags (button) ?

    Jamal_Soueidan Level 1
      Hello there,

      I have a small problem with my code.

      This is my button tag.
      <mx:Button x="331" y="27" label="Vælge filer" id="browse"/>

      And in my script tag
      <mx:Script><![CDATA[
      import multi.*;
      public var jamal:UIClass = new UIClass(browse);
      ]]></mx:Script>

      I'm trying to send a reference about the button to my UIClass which holds the event for this button.

      But I'm getting weird errors which looks like this.

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at multi::UIClass()
      at main()
      at _main_mx_managers_SystemManager/create()
      at mx.managers::SystemManager/private::initializeTopLevelWindow()
      at mx.managers::SystemManager/private::docFrameHandler()
      at [execute-queued]

      Hope someone can tell me what im doing wrong?

      Regards,
      Jamal
        • 1. Re: access mx tags (button) ?
          Yann Martel
          Hi,
          I think you should wait for CREATION_COMPLETE Event before using your "browse" var. You're trying to access it too early in your Script, when the Button isn't built. That would explain the "null object reference", but I'm not sure since I don't know what your UIClass constructor does.

          Hope that helps.