I am building a select list widget, and I wish to catch the mousedown event on the document, in order to close the select box if it is open. I have tried the following code, but I get an error saying 'DynAPI.document is null or not an object' (referring to the first line of the EventListener).
 
This doesn't make since I have already added my select list widget to the DynAPI.document object as a child (haven't I?!!!)
 
Any help appreciated, Ben
 
-------------------code start---------------------
 
 <script language="JavaScript" src="../dynapi2_51/dynapi/src/dynapi.js"></script>
 <script language="Javascript">
 
  DynAPI.setLibraryPath('../dynapi2_51/dynapi/src/lib/');
  
  DynAPI.include('dynapi.api.*');
  DynAPI.include('dynapi.event.*')
  DynAPI.include('dynapi.gui.label.js')
  DynAPI.include('dynapi.gui.list.js')
  DynAPI.include('dynapi.util.thread.js')
  DynAPI.include('dynapi.util.pathanim.js');
  DynAPI.include('selectList.js','./')
  
  DynAPI. {
   select1 = new selectList('test')
   DynAPI.document.addChild(select1)
  }
  
  DynAPI.document.events = new EventListener(DynAPI.document)
   DynAPI.document.>    alert('test')
   }
  DynAPI.document.addEventListener(DynAPI.document.events)
 
 </script>
 
--------------------code end----------------------------

Reply via email to