6 Replies Latest reply on Jun 10, 2006 1:14 AM by ur_dtrain

    Access of undefined property

      I am new to Actionscript and have some basic questions

      I tried to compile following codes but got an error "Access of undefined property em".
      What I tried to do was
      - create an instance of EventManager
      - access a function of the instance

      I am a javascript guy and
      did it in a javascript way. I really appreciate if anyone point out what was wrong?

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">

      public var em:EventManager = new EventManager();
      em._registerEvent("validate", function validate() {
      mx.controls.Alert.show(null, 'Enter validation');
      <mx:Form width="420" height="297">

      Here is the EventManager.as:

      package {
      public class EventManager

      public function _registerEvent(eType:String, handler:Function)