[Laszlo-checkins] r5722 - in openlaszlo/branches/legals/WEB-INF/lps/lfc: controllers core data data/platform/swf events helpers kernel kernel/dhtml kernel/swf services services/platform/dhtml services/platform/swf views

max@openlaszlo.org max at openlaszlo.org
Thu Jul 19 18:33:47 PDT 2007


Author: max
Date: 2007-07-19 18:33:20 -0700 (Thu, 19 Jul 2007)
New Revision: 5722

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzDefs.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataText.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/platform/swf/LzConnection.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzCommand.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzState.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/LzLibraryCleanup.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzContextMenu.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMediaLoader.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzFocus.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzIdle.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzModeManager.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzText.lzs
Log:
Change 20070719-maxcarlson-r by maxcarlson at plastik on 2007-07-19 11:16:47 PDT
    in /Users/maxcarlson/openlaszlo/legals-checkin
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Only send events when there is a delegate ready to listen

New Features:

Bugs Fixed: LPP-4330 - Only send events when there is a delegate ready to listen

Technical Reviewer: promanik
QA Reviewer: ptw
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: LzDefs.lzs - Add LzDeclaredEvent.ready = false flag. toString() returns the classname.

LaszloEvents.lzs -  Add LzDeclaredEvent.ready flag, defaulting to false.  Set ready to true when delegateList length > 0.  Use array.ush instead of evq[evq.length].  Cache keep length.

LzTextSprite.as - Use __lzview instead of __control - should fix __updatefieldsize().  Check event ready flag before calling sendEvent().

LzInputTextSprite.as - Make constructor more similar to LzTextSprite.

Check event ready flag before calling sendEvent(), except where noted:
kernel/swf/LzLoader.lzs
kernel/swf/LzMediaLoader.lzs
kernel/swf/LzContextMenu.lzs
kernel/swf/LzLoadQueue.lzs
kernel/swf/LzLibraryLoader.lzs
kernel/swf/LzMakeLoadSprite.lzs
kernel/swf/LzSprite.lzs
kernel/dhtml/LzContextMenu.lzs 
kernel/LzLibraryCleanup.lzs 
services/LzTrack.lzs
services/platform/swf/LzKeys.as
services/platform/swf/LzHistory.as
services/platform/dhtml/LzHistory.js
services/platform/dhtml/LzKeys.js
services/LzGlobalMouse.lzs
services/LzIdle.lzs
services/LzFocus.lzs
services/LzModeManager.lzs
core/LzNode.lzs
views/LzInputText.lzs
views/LzText.lzs - Remove unused __updatefieldsize() method.
views/LaszloView.lzs
views/LaszloCanvas.lzs
helpers/LzCommand.lzs
helpers/LzState.lzs
controllers/LzAnimatorGroup.lzs
controllers/LaszloAnimation.lzs
data/LzReplicationManager.lzs
data/LzLazyReplicationManager.lzs
data/platform/swf/LzConnection.lzs
data/LzDatapointer.lzs
data/LzDataText.lzs
data/LzDataNode.lzs
data/LzDataElement.lzs
data/LzDataset.lzs
data/LzResizeReplicationManager.lzs
data/LzDatapath.lzs

Tests: ant lztest.  All applications run as before.  Firebug shows 5545 less function calls for examples/components/style_example.lzx?lzt=html&lzr=dhtml.  LzDeclaredEvent.sendEvent() goes from being the second most frequently called method at 6171 calls to 476 calls.



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -260,7 +260,7 @@
     this.startTime = time;
     this.lastIterationTime = time;
 
-    this.onstart.sendEvent( time );
+    if (this.onstart.ready) this.onstart.sendEvent( time );
 
     //Set to false so next update does not call this function
     this.doBegin = false;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -257,7 +257,7 @@
             }
         }
     }
-    this.ontarget.sendEvent( new_target );
+    if (this.ontarget.ready) this.ontarget.sendEvent( new_target );
 }
 
 /**
@@ -266,7 +266,7 @@
   */
 function setStart ( start ){
     this.started = start;
-    this.onstarted.sendEvent( start );
+    if (this.onstarted.ready) this.onstarted.sendEvent( start );
     if ( !this.isinited ){
         return;
     }
@@ -290,7 +290,7 @@
     //this.target.anmExecuteCount += 1;
 
     //Debug.info('doStart', start);
-    this.onstart.sendEvent( (new Date()).getTime() );
+    if (this.onstart.ready) this.onstart.sendEvent( (new Date()).getTime() );
     //this is a bug -- embedded animators won't send onstart
 
     this.isactive = true;
@@ -405,7 +405,7 @@
     }
 
     this.paused = dop;
-    this.onpaused.sendEvent( dop );
+    if (this.onpaused.ready) this.onpaused.sendEvent( dop );
 }
 
 /**
@@ -452,8 +452,8 @@
     this.isactive = false;
     //unreg for update event
     this.updateDel.unregisterAll();
-    this.onfinish.sendEvent( this );
-    this.onstop.sendEvent( (new Date()).getTime() );
+    if (this.onfinish.ready) this.onfinish.sendEvent( this );
+    if (this.onstop.ready) this.onstop.sendEvent( (new Date()).getTime() );
 }
 
 /**
@@ -467,7 +467,7 @@
 
     if ( this.crepeat > 0 ) {
         this.crepeat--;
-        this.onrepeat.sendEvent( (new Date()).getTime() );
+        if (this.onrepeat.ready) this.onrepeat.sendEvent( (new Date()).getTime() );
     }
     //this.prepareStart();
     this.resetAnimator();

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzDefs.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzDefs.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzDefs.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -38,12 +38,17 @@
   * @access private
   */
 LzDeclaredEvent.toString = function ( ){
-    return "Declared event";
+    return "LzDeclaredEvent";
 }
 
 /**
   * @access private
   */
+LzDeclaredEvent.ready = false;
+
+/**
+  * @access private
+  */
 function DeclareEvent( who , what ){
     //    Debug.debug('declare ' + who + ' what ' + what);
     who[ what ] = LzDeclaredEvent;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -188,7 +188,7 @@
             LzDelegate.__LZdrainDelegatesQueue(qpos);
         }
 
-        this.onconstruct.sendEvent( this );
+        if (this.onconstruct.ready) this.onconstruct.sendEvent( this );
 
         if ( children && children.length ){
             this.createChildren( children );
@@ -737,7 +737,7 @@
     }
 
     this.init();
-    this.oninit.sendEvent( this );
+    if (this.oninit.ready) this.oninit.sendEvent( this );
     if (this.datapath && this.datapath.__LZApplyDataOnInit) {
         this.datapath.__LZApplyDataOnInit();
     }
@@ -809,7 +809,7 @@
                   //value changed.
                   var evt = ("on" + a);
                   if (evt in this) {
-                      this[ evt ].sendEvent( args[ a ] );
+                      if (this[evt].ready) this[ evt ].sendEvent( args[ a ] );
                   } 
               }
           } else if (setrs &&  setrs[ a ] != -1 ){
@@ -912,7 +912,7 @@
         this[ prop ] = val;
         var evt = ("on" + prop);
         if (evt in this) {
-            this[ evt ].sendEvent( val );
+            if (this[evt].ready) this[ evt ].sendEvent( val );
         }
     }
 
@@ -1729,7 +1729,7 @@
 
     this.__LZdeleted = true;
 
-    this.ondestroy.sendEvent( this );
+    if (this.ondestroy.ready) this.ondestroy.sendEvent( this );
 
     //don't allow a call on this method if I'm deleted
     this.__LZinstantiationDone = null;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -63,8 +63,8 @@
             newChild.setOwnerDocument( this.ownerDocument );
 
             newChild.parentNode = this;
-            newChild.onparentNode.sendEvent( this );
-            this.onchildNodes.sendEvent( newChild );
+            if (newChild.onparentNode.ready) newChild.onparentNode.sendEvent( this );
+            if (this.onchildNodes.ready) this.onchildNodes.sendEvent( newChild );
             this.ownerDocument.handleDocumentChange( "insertBefore" , 
                                                      this, 0 );
             return newChild;
@@ -92,8 +92,8 @@
             newChild.setOwnerDocument( this.ownerDocument );
 
             newChild.parentNode = this;
-            newChild.onparentNode.sendEvent( this );
-            this.onchildNodes.sendEvent( newChild );
+            if (newChild.onparentNode.ready) newChild.onparentNode.sendEvent( this );
+            if (this.onchildNodes.ready) this.onchildNodes.sendEvent( newChild );
             this.ownerDocument.handleDocumentChange( "childNodes" , this , 0, newChild );
             return newChild;
         }
@@ -113,7 +113,7 @@
     for ( var i = 0; i < this.childNodes.length; i++ ){
         if ( this.childNodes[ i ] == oldChild ){
             this.childNodes.splice( i , 1 );
-            this.onchildNodes.sendEvent( oldChild );
+            if (this.onchildNodes.ready) this.onchildNodes.sendEvent( oldChild );
             reval = oldChild;
             this.ownerDocument.handleDocumentChange("removeChild", this, 0, oldChild);
         }
@@ -137,12 +137,12 @@
     newChild.setOwnerDocument( this.ownerDocument );
 
     newChild.parentNode = this;
-    newChild.onparentNode.sendEvent( this );
+    if (newChild.onparentNode.ready) newChild.onparentNode.sendEvent( this );
 
     //instead of marking dirty, this is easy
     newChild.__LZo = this.childNodes.length -1;
 
-    this.onchildNodes.sendEvent( newChild );
+    if (this.onchildNodes.ready) this.onchildNodes.sendEvent( newChild );
     this.ownerDocument.handleDocumentChange( "appendChild" , this , 0, newChild );
     return newChild;
 }
@@ -199,7 +199,7 @@
       this.attributes = {};
     }
     this.attributes[ name ] = value;
-    this.onattributes.sendEvent( name );
+    if (this.onattributes.ready) this.onattributes.sendEvent( name );
     this.ownerDocument.handleDocumentChange( "attributes" , this , 1, {name: name, value: value, type: 'set'});
     return value;
 }
@@ -211,7 +211,7 @@
 function removeAttr (name){
     var v = this.attributes[ name ];
     delete this.attributes[ name ];
-    this.onattributes.sendEvent( name );
+    if (this.onattributes.ready) this.onattributes.sendEvent( name );
     this.ownerDocument.handleDocumentChange( "attributes" , this , 1, {name: name, value: v, type: 'remove'});
     return v;
 }
@@ -312,7 +312,7 @@
     for ( var k in attrs ){ a[ k ] = attrs[ k ]; }
 
     this.attributes = a;
-    this.onattributes.sendEvent( a);
+    if (this.onattributes.ready) this.onattributes.sendEvent( a);
     if (this.ownerDocument) {
         this.ownerDocument.handleDocumentChange( "attributes" , this , 1);
     }
@@ -330,13 +330,13 @@
         c.setOwnerDocument( this.ownerDocument );
         c.parentNode = this;
         if (c.onparentNode) {
-            c.onparentNode.sendEvent( this );
+            if (c.onparentNode.ready) c.onparentNode.sendEvent( this );
         }
         c.__LZo = i;
     }
     this.__LZcoDirty = false;
     if (this.onchildNodes) {
-        this.onchildNodes.sendEvent( children );
+        if (this.onchildNodes.ready) this.onchildNodes.sendEvent( children );
     }
     this.ownerDocument.handleDocumentChange( "childNodes" , this , 0);
 }
@@ -349,10 +349,10 @@
     //Debug.write('setting node name from "',this.nodeName, '" to "', name, '"');
     this.nodeName = name;
     //since this can affect xpaths, send onchildNodes event
-    this.onnodeName.sendEvent( name );
+    if (this.onnodeName.ready) this.onnodeName.sendEvent( name );
     if (this.parentNode) {
-        this.parentNode.onchildNodes.sendEvent( this );
-        this.parentNode.onchildNode.sendEvent( this );
+        if (this.parentNode.onchildNodes.ready) this.parentNode.onchildNodes.sendEvent( this );
+        if (this.parentNode.onchildNode.ready) this.parentNode.onchildNode.sendEvent( this );
     }
     this.ownerDocument.handleDocumentChange( "childNodeName" , 
                                              this.parentNode , 0 );
@@ -499,7 +499,7 @@
     if ( this.__LZchangeQ ){
         this.__LZchangeQ.push ( o );
     } else {
-        this.onDocumentChange.sendEvent( o );
+        if (this.onDocumentChange.ready) this.onDocumentChange.sendEvent( o );
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -143,7 +143,7 @@
         }
     }
 
-    if (this.onownerDocument) {
+    if (this.onownerDocument && this.onownerDocument.ready) {
         this.onownerDocument.sendEvent( ownerDoc );
     }
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataText.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataText.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataText.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -54,7 +54,7 @@
   */
 function setData ( newdata ) {
     this.data = newdata;
-    if (this.ondata) {
+    if (this.ondata && this.ondata.ready) {
         this.ondata.sendEvent( newdata );
     }
     if (this.ownerDocument) {

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -306,7 +306,7 @@
     ip.data = this.data;
 
 
-    if ( cdat ){
+    if ( cdat && ip.ondata.ready){
         ip.ondata.sendEvent( this.data );
     }
 
@@ -470,8 +470,8 @@
   */
 function __LZHandleDocChange ( who ){
     if ( super.__LZHandleDocChange.apply(this, arguments) ){
-        this.immediateparent.ondata.sendEvent( this.data );
-        this.onDocumentChange.sendEvent( who );
+        if (this.immediateparent.ondata.ready) this.immediateparent.ondata.sendEvent( this.data );
+        if (this.onDocumentChange.ready) this.onDocumentChange.sendEvent( who );
     }
 }
 
@@ -497,7 +497,7 @@
   */
 function __LZcheckChange ( chgpkg ){
     if ( !super.__LZcheckChange.apply(this, arguments) ){
-        if ( chgpkg.who.childOf( this.p , true ) ){
+        if ( chgpkg.who.childOf( this.p , true ) && this.onDocumentChange.ready){
             this.onDocumentChange.sendEvent( chgpkg );
         }
     }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -167,7 +167,7 @@
   * @access private
   */
 function gotError ( msg ){
-    this.onerror.sendEvent( msg );
+    if (this.onerror.ready) this.onerror.sendEvent( msg );
 }
 
 /**
@@ -175,7 +175,7 @@
   * @access private
   */
 function gotTimeout ( msg ){
-    this.ontimeout.sendEvent( msg );
+    if (this.ontimeout.ready) this.ontimeout.sendEvent( msg );
 }
 
 /**
@@ -450,7 +450,7 @@
             }
 
             this.p = this.context;
-            this.ondata.sendEvent( this.p );
+            if (this.ondata.ready) this.ondata.sendEvent( this.p );
         }
         return;
     }
@@ -528,14 +528,14 @@
 
 
     if ( this.__LZdchanged) {
-        this.ondata.sendEvent( this.data );
+        if (this.ondata.ready) this.ondata.sendEvent( this.data );
         this.__LZdchanged = false;
     }
 
     if ( this.__LZpchanged) {
-        this.onp.sendEvent( this.p );
+        if (this.onp.ready) this.onp.sendEvent( this.p );
         this.__LZpchanged = false;
-        this.onDocumentChange.sendEvent( { who: this.p , 
+        if (this.onDocumentChange.ready) this.onDocumentChange.sendEvent( { who: this.p , 
                                            type: 2 , 
                                            what: 'context'});
     }
@@ -782,7 +782,7 @@
 function __LZsetRerunXPath ( rrx ){
     this.rerunxpath = rrx;
 
-    this.onrerunxpath.sendEvent( rrx );
+    if (this.onrerunxpath.ready) this.onrerunxpath.sendEvent( rrx );
 }
 
 /**
@@ -1343,7 +1343,7 @@
         track = track.parentNode;
     } while( track && track != who.ownerDocument );
 
-    if ( meorbelowme ) this.ondata.sendEvent( this.data );
+    if ( meorbelowme && this.ondata.ready) this.ondata.sendEvent( this.data );
     return meorbelowme;
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -389,7 +389,7 @@
     }
     this.responseheaders = headers;
 
-    this.ondata.sendEvent( this );
+    if (this.ondata.ready) this.ondata.sendEvent( this );
 }
 
 
@@ -400,7 +400,7 @@
   */
 function gotError ( e ){
     this.errorstring = e;
-    this.onerror.sendEvent( this );
+    if (this.onerror.ready) this.onerror.sendEvent( this );
 }
 
 /**
@@ -408,7 +408,7 @@
   * @access private
   */
 function gotTimeout (){
-    this.ontimeout.sendEvent( this );
+    if (this.ontimeout.ready) this.ontimeout.sendEvent( this );
 }
 
 /**

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -255,7 +255,7 @@
             if (this.nodes) {
                 cl.datapath.setClonePointer( this.nodes[ newstart + i ]);
             }
-            cl.onclonenumber.sendEvent( i );
+            if (cl.onclonenumber.ready) cl.onclonenumber.sendEvent( i );
         } else {
             //otherwise, the oldclone and the newclone match
             this.clones[ i ] = oldclones[ i + offset ];

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -369,7 +369,7 @@
     this.hasdata = true;
     var lastnodes = this.nodes;
     this.nodes = n;
-    this.onnodes.sendEvent( this.nodes );
+    if (this.onnodes.ready) this.onnodes.sendEvent( this.nodes );
 
     if ( this.__LZspecialDotDot ) this.__LZsetupDotDot( n[ 0 ] );
 
@@ -387,11 +387,11 @@
         if (this.nodes) {
             cl.datapath.setClonePointer( this.nodes[ iplusoffset ] );
         }
-        cl.onclonenumber.sendEvent( iplusoffset );
+        if (cl.onclonenumber.ready) cl.onclonenumber.sendEvent( iplusoffset );
     }
     
 
-    this.onclones.sendEvent( this.clones );
+    if (this.onclones.ready) this.onclones.sendEvent( this.clones );
 
 
 }
@@ -627,7 +627,7 @@
     for ( var i = 0; i < this.clones.length; i++ ){
         this.clones[ i ].setVisible( vis );
     }
-    this.onvisible.sendEvent( vis );
+    if (this.onvisible.ready) this.onvisible.sendEvent( vis );
 }
 
 /**
@@ -656,7 +656,7 @@
                 cl.datapath.__LZsetData();
             }
             if ( who.childOf( cl.datapath.p , true ) ){
-                cl.datapath.onDocumentChange.sendEvent( chgpkg ) ;
+                if (cl.datapath.onDocumentChange.ready) cl.datapath.onDocumentChange.sendEvent( chgpkg ) ;
             }
         }
     }
@@ -691,7 +691,7 @@
     }
 
     cl.datapath.__LZtrackDel.unregisterAll();
-    cl.immediateparent.onremovesubview.sendEvent( cl );
+    if (cl.immediateparent.onremovesubview.ready) cl.immediateparent.onremovesubview.sendEvent( cl );
     cl.isdetatchedclone = true;
     cl.p = null;
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -243,7 +243,7 @@
             cl = this.getNewClone( );
             cl.clonenumber = i + newoffset;
             cl.datapath.setClonePointer( cnode );
-            cl.onclonenumber.sendEvent( i + newoffset );
+            if (cl.onclonenumber.ready) cl.onclonenumber.sendEvent( i + newoffset );
             this.clones[ i ] = cl;
         }
         //Debug.write( i, cl , clpos, csiz );

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/platform/swf/LzConnection.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/platform/swf/LzConnection.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/platform/swf/LzConnection.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -353,7 +353,7 @@
 function __LZunloadConnection1 ()
 {
     this.__LZloader.unload();
-    this.__LZoninternaldisconnect.sendEvent(); 
+    if (this.__LZoninternaldisconnect.ready) this.__LZoninternaldisconnect.sendEvent(); 
 }
 
 
@@ -460,10 +460,10 @@
             if (dsrc[name] != null) {
                 // pass down just <root>
                 dsrc[name].setData(rdata);
-                dsrc.ondata.sendEvent(rdata);
+                if (dsrc.ondata.ready) dsrc.ondata.sendEvent(rdata);
             }
         }
-        this.ondata.sendEvent( rdata );
+        if (this.ondata.ready) this.ondata.sendEvent( rdata );
 
     }
 }
@@ -474,11 +474,11 @@
   */
 function __LZsendEvent (event, obj)
 {
-    this[event].sendEvent( obj );
+    if (this[event].ready) this[event].sendEvent( obj );
     for (var d in this.__LZdatasources) {
         var dsrc = this.__LZdatasources[d];
         //Debug.write('sending event', event, 'to ', dsrc, 'with value ',  obj);
-        dsrc[event].sendEvent( obj );
+        if (dsrc[event].ready) dsrc[event].sendEvent( obj );
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -172,7 +172,8 @@
     }
     //now fix it 
     this.lastevent = 0;
-    for ( var i = 0; i < keep.length; i++ ){
+    var l = keep.length;
+    for ( var i = 0; i < l; i++ ){
         this[ this.lastevent++ ] = keep[ i ];
     }
 }
@@ -351,6 +352,7 @@
     eventSender[ eventName ] = this;
     if ( d ){
         this.delegateList = [d];
+        this.ready = true;
     }else{
         this.delegateList = [];
     }
@@ -373,6 +375,10 @@
   */
 var locked = false;
 
+/** True when event is ready to be sent.
+  * 
+  */
+var ready = false;
 
 /**
   *  Adds the given delegate to the event's delegate list. Although this listed
@@ -382,6 +388,7 @@
   *  @param LzDelegate d: The delegate to add to the list of delegates called by the event.
   */
 function addDelegate (d){
+    this.ready = true;
     this.delegateList.push(d);
 }
 
@@ -424,8 +431,7 @@
             // properly managed
             if (d.enabled && d.c) {
                 if (d.c.__LZdeferDelegates) {
-                    evq[evq.length] = d;
-                    evq[evq.length] = sd;
+                    evq.push(d, sd);
                 } else {
                   // d.execute( sd ); inlined
                   d.c[d.f]( sd );
@@ -467,7 +473,7 @@
         }
     }
     if ( this.delegateList.length == 0 ){
-        this.hasNoDelegates = true;
+        this.ready = false;
     }
 }
 
@@ -479,7 +485,7 @@
         this.delegateList[ 0 ].unregisterFrom( this );
     }
     //this.delegateList = [];
-    this.hasNoDelegates = true;
+    this.ready = false;
 }
 
 /**

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzCommand.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzCommand.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzCommand.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -74,7 +74,7 @@
   */
 function execute ( d ){
     if ( this.active ){
-        this.onselect.sendEvent( d );
+        if (this.onselect.ready) this.onselect.sendEvent( d );
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzState.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzState.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/helpers/LzState.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -209,7 +209,7 @@
 
     this.parent.__LZdelegates = od;
 
-    this.onapply.sendEvent( this );
+    if (this.onapply.ready) this.onapply.sendEvent( this );
 }
 
 /**
@@ -222,7 +222,7 @@
         return;
     }
 
-    this.onremove.sendEvent( this );
+    if (this.onremove.ready) this.onremove.sendEvent( this );
     this.isapplied = false;
 
     if (this.__LZstatedelegates) {

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/LzLibraryCleanup.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/LzLibraryCleanup.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/LzLibraryCleanup.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -24,7 +24,7 @@
         super.initialize.apply(this, arguments);
         var lib = LzLibrary.findLibrary(args.libname);
         lib.loading = false;
-        lib.onload.sendEvent(true);
+        if (lib.onload.ready) lib.onload.sendEvent(true);
     }
 
 }; // End of LzLibraryCleanup

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js	2007-07-20 01:33:20 UTC (rev 5722)
@@ -61,7 +61,7 @@
         s.setAttribute('style', 'display: none');
         document.body.appendChild(s);
     }
-    this.onmenuopen.sendEvent(this);
+    if (this.onmenuopen.ready) this.onmenuopen.sendEvent(this);
 
     var o = '';
     for (var i = 0; i < this.items.length; i++) {
@@ -173,7 +173,7 @@
 
 /** @access private */
 function __select() {
-    this.onselect.sendEvent(this);
+    if (this.onselect.ready) this.onselect.sendEvent(this);
     if (this._delegate != null) {
         if (this._delegate instanceof LzDelegate) {
             this._delegate.execute(this);

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzContextMenu.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzContextMenu.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzContextMenu.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -43,7 +43,7 @@
   var __litem__ = this;
   var callback =  function (mc,cmitem) {
       if (delegate != null) delegate.execute(__litem__);
-      __litem__.onmenuopen.sendEvent(__litem__);
+      if (__litem__.onmenuopen.ready) __litem__.onmenuopen.sendEvent(__litem__);
   };
   this.cm.onSelect = callback;
 }
@@ -148,7 +148,7 @@
               Debug.error("LzContextMenuItem.setDelegate must be passed a delegate or function", this, delegate);
           }
       }
-      __litem__.onselect.sendEvent(__litem__);
+      if (__litem__.onselect.ready) __litem__.onselect.sendEvent(__litem__);
   };
   this.cmenuitem.onSelect = callback;
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -43,8 +43,9 @@
     //Debug.write('created', textclip, 'in', mc, txtname);
 
     this.__LZtextclip = textclip;
+    // set a pointer back to this view from the TextField object
+    textclip.__lzview = this.owner;
     textclip._visible = true;
-    textclip.__control = this;
     
     this.password = args.password  ? true : false;
     textclip.password = this.password;
@@ -167,8 +168,6 @@
         textclip.type = 'dynamic';
     }
 
-    // set a pointer back to this view from the TextField object
-    this.__LZtextclip.__lzview = this.owner;
     this.__LZtextclip.__cacheSelection = TextField.prototype.__cacheSelection;
     textclip.onSetFocus = TextField.prototype.__gotFocus;
     textclip.onKillFocus = TextField.prototype.__lostFocus;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -72,10 +72,10 @@
     // this snippetLoaded method with an error arg.
 
     if ( err != null ){
-      Debug.write( err );
+      //Debug.write( err );
         this.owner.loaded = true;
         this.owner.loading = false;
-        this.owner.onerror.sendEvent( err );
+        if (this.owner.onerror.ready) this.owner.onerror.sendEvent( err );
         return;
     }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -101,7 +101,7 @@
         Debug.warn("LzLoadQueue.XMLOnDataHandler load failed from URL %w, no data received.", this.url);
         Debug.warn("Failure to load data in serverless apps may be caused by Flash player security policies. Check your data server crossdomain.xml file");
         this.onload(false);
-        this.dataset.onerror.sendEvent(this.dataset);
+        if (this.dataset.onerror.ready) this.dataset.onerror.sendEvent(this.dataset);
         // cancel the timeout handler
         LzLoadQueue.unloadRequest(this);
   } else {

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -201,7 +201,7 @@
 
     if ( err != null ){
         Debug.error( err );
-        this.onerror.sendEvent( data );
+        if (this.onerror.ready) this.onerror.sendEvent( data );
         return;
     }
 
@@ -214,7 +214,7 @@
             if ( tlmc.timedout ){
                 this.doTimeOut(tlmc);
             } else if( tlmc.data ){
-                this.ondata.sendEvent( tlmc.data );
+                if (this.ondata.ready) this.ondata.sendEvent( tlmc.data );
                 tlmc.data = null;
             }
         }
@@ -222,7 +222,7 @@
         if ( loadobj.timedout ){
             this.doTimeOut(loadobj);
         } else if( data ){
-            this.ondata.sendEvent( data );
+            if (this.ondata.ready) this.ondata.sendEvent( data );
         }
     }
 }
@@ -335,7 +335,7 @@
     o.lzr = canvas.runtime;
 
     LzLoadQueue.enqueueRequest( lmv );
-    this.onrequest.sendEvent(o);
+    if (this.onrequest.ready) this.onrequest.sendEvent(o);
 }
 
 function setHeaders (headers) {
@@ -351,7 +351,7 @@
     LzLoadQueue.enqueueRequest( o );
     // We should probably be passing something other than the obj itself to
     // the onrequest event
-    this.onrequest.sendEvent(o);
+    if (this.onrequest.ready) this.onrequest.sendEvent(o);
 }
 
 /**
@@ -397,7 +397,7 @@
     }
     if (loadobj) {
         this.unload(loadobj);
-        this.ontimeout.sendEvent( loadobj.reqobj.dataset );
+        if (this.ontimeout.ready) this.ontimeout.sendEvent( loadobj.reqobj.dataset );
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -168,7 +168,7 @@
     if ( tfchg ){
         this.totalframes = mc._totalframes;
         this.owner.totalframes = mc._totalframes;
-        if (this.owner.ontotalframes) this.owner.ontotalframes.sendEvent( this.totalframes );
+        if (this.owner.ontotalframes && this.owner.ontotalframes.ready) this.owner.ontotalframes.sendEvent( this.totalframes );
     }
 
     if ( this.totalframes > 1 ){

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMediaLoader.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMediaLoader.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzMediaLoader.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -234,7 +234,7 @@
              if ( !this.sentLoadStart ){
                  this.sentLoadStart = true;
                  if ( ! this.mc.loaded ) {
-                     this.onstreamstart.sendEvent( this );
+                     if (this.onstreamstart.ready) this.onstreamstart.sendEvent( this );
                  }
              }
 
@@ -256,12 +256,12 @@
                      }
 
                      this.owner.owner.loadperc = nlp;
-                     this.owner.owner.onloadperc.sendEvent( this.owner.owner.loadperc );
+                     if (this.owner.owner.onloadperc.ready) this.owner.owner.onloadperc.sendEvent( this.owner.owner.loadperc );
                      this.owner.owner.setAttribute( "framesloadratio" , nlp );
                      this.owner.owner.setAttribute( "loadratio" , nlp );
 
                      if ( this.mc.lmc._totalframes == this.mc.lmc._framesloaded && this.mc.lmc._currentframe > 0){
-                         if (!this.mc.loaded) this.onloaddone.sendEvent( this );
+                         if (!this.mc.loaded && this.onloaddone.ready) this.onloaddone.sendEvent( this );
                          this.returnData( this.mc );
                      }
                  }
@@ -278,7 +278,7 @@
                  //into the LFC by the time the load is detected. If this is
                  //wrong, then the view will send both onload and onrror.
                  if ( ! this.mc.loaded ) {
-                     this.onstreamstart.sendEvent( this );
+                     if (this.onstreamstart.ready) this.onstreamstart.sendEvent( this );
                  }
              }
 
@@ -292,14 +292,14 @@
                  }
 
                  this.owner.owner.loadperc = nlp;
-                 this.owner.owner.onloadperc.sendEvent( this.owner.owner.loadperc );
+                 if (this.owner.owner.onloadperc.ready) this.owner.owner.onloadperc.sendEvent( this.owner.owner.loadperc );
                  this.owner.owner.setAttribute( "framesloadratio" , nlp );
              }
 
              if ( this.mc.lmc.getBytesTotal() == this.mc.lmc.getBytesLoaded() ){
                  //load is done
 
-                 if (!this.mc.loaded) this.onloaddone.sendEvent( this );
+                 if (!this.mc.loaded && this.onloaddone.ready) this.onloaddone.sendEvent( this );
                  //if mc.loaded is set, means returnData has already been called
                  //(probably by error swf.)
                  if ( !this.mc.loaded ){
@@ -320,7 +320,7 @@
     super.unload( loadobj );
     if ( this.owner.owner.loadratio != 0 ){
         this.owner.owner.loadperc = 0;
-        this.owner.owner.onloadperc.sendEvent( 0 );
+        if (this.owner.owner.onloadperc.ready) this.owner.owner.onloadperc.sendEvent( 0 );
         this.owner.owner.setAttribute( "loadratio" , 0 );
         this.owner.owner.setAttribute( "framesloadratio" , 0 );
     }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -398,7 +398,7 @@
 
 
     //@event onaddsubresource: Sent when a child view adds a resource
-    if (this.owner.onaddsubresource) this.owner.onaddsubresource.sendEvent( childsprite.owner );
+    if (this.owner.onaddsubresource && this.owner.onaddsubresource.ready) this.owner.onaddsubresource.sendEvent( childsprite.owner );
 
     return newmc;
 }
@@ -1306,7 +1306,7 @@
         this.frame = c;
         this.owner.frame = this.frame;
         //@event onframe: Sent onidle while view is playing its resource
-        this.owner.onframe.sendEvent(this.frame);
+        if (this.owner.onframe.ready) this.owner.onframe.sendEvent(this.frame);
     }
 
     var tf = this.getMCRef()._totalframes;
@@ -1322,7 +1322,7 @@
         //@event onlastframe: Sent when the view sets its frame (resource
         //number) to the last frame. This can be used to find out when a
         //streaming media clip is done playing.
-        this.owner.onlastframe.sendEvent(this.owner);
+        if (this.owner.onlastframe.ready) this.owner.onlastframe.sendEvent(this.owner);
         this.checkPlayStatus();
     }
 }
@@ -1403,7 +1403,7 @@
 
     this.trackPlay();
     //@event onplay: Sent when a view begins playing its resource
-    this.owner.onplay.sendEvent(this);
+    if (this.owner.onplay.ready) this.owner.onplay.sendEvent(this);
 }
 
 /**
@@ -1430,7 +1430,7 @@
     //@event onstop: Sent when a view's resource that is capable of playing is
     //stopped. This is only called if stop is called directly; when a resource
     //hits its last frame, the LzView event onlastframe is called.
-    if ( this.playing ) this.owner.onstop.sendEvent(this);
+    if ( this.playing && this.owner.onstop.ready ) this.owner.onstop.sendEvent(this);
     this.stopTrackPlay();
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -42,10 +42,9 @@
 
     this.__LZtextclip = textclip;
     // set a pointer back to this view from the TextField object
-    this.__LZtextclip.__lzview = this.owner;
+    textclip.__lzview = this.owner;
     this.__LZtextclip.__cacheSelection = TextField.prototype.__cacheSelection;
     textclip._visible = true;
-    textclip.__control = this;
 
     this.text =  args.text == null ? "" : args.text;
 
@@ -347,7 +346,7 @@
 LzTextSprite.prototype.setXScroll = function ( n ){
     this.__LZtextclip._x = Math.floor(Math.min(0, n));
     this.xscroll = this.__LZtextclip._x;
-    this.onxscroll.sendEvent(this.__LZtextclip._x);
+    if (this.onxscroll.ready) this.onxscroll.sendEvent(this.__LZtextclip._x);
 }
 
 /**
@@ -841,21 +840,21 @@
   * __LZtextclip from __LZforceScrollAttrs
   */
 LzTextSprite.prototype.__updatefieldsize = function ( ){
-    if ( this.__control.scroll != this.scroll) {
-        this.__control.scroll = this.scroll;
-        this.__control.onscroll.sendEvent(this.scroll)
+    if ( this.__lzview.scroll != this.scroll) {
+        this.__lzview.scroll = this.scroll;
+        if (this.__lzview.onscroll.ready) this.__lzview.onscroll.sendEvent(this.scroll)
     }
-    if (this.__control.maxscroll != this.maxscroll) {
-        this.__control.maxscroll = this.maxscroll;
-        this.__control.onmaxscroll.sendEvent(this.maxscroll)
+    if (this.__lzview.maxscroll != this.maxscroll) {
+        this.__lzview.maxscroll = this.maxscroll;
+        if (this.__lzview.onmaxscroll.ready) this.__lzview.onmaxscroll.sendEvent(this.maxscroll)
     }
-    if (this.__control.hscroll != this.hscroll) {
-        this.__control.hscroll = this.hscroll;
-        this.__control.onmaxscroll.sendEvent(this.hscroll)
+    if (this.__lzview.hscroll != this.hscroll) {
+        this.__lzview.hscroll = this.hscroll;
+        if (this.__lzview.onhscroll.ready) this.__lzview.onhscroll.sendEvent(this.hscroll)
     }
-    if (this.__control.maxhscroll != this.maxhscroll) {
-        this.__control.maxhscroll = this.maxhscroll;
-        this.__control.onmaxscroll.sendEvent(this.maxhscroll)
+    if (this.__lzview.maxhscroll != this.maxhscroll) {
+        this.__lzview.maxhscroll = this.maxhscroll;
+        if (this.__lzview.onmaxhscroll.ready) this.__lzview.onmaxhscroll.sendEvent(this.maxhscroll)
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzFocus.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzFocus.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzFocus.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -57,8 +57,7 @@
   */
 LzFocus.gotKeyUp = function( kC ){
     //Debug.write("gotKeyUp "+kC);
-    if (this.csel)
-        this.csel.onkeyup.sendEvent( kC );
+    if (this.csel && this.csel.onkeyup.ready) this.csel.onkeyup.sendEvent( kC );
 }
 
 /**
@@ -66,7 +65,7 @@
   */
 LzFocus.gotKeyDown = function( kC ){
     //Debug.write("gotKeyDown ", kC, LzKeys.isKeyDown('shift'));
-    if (this.csel)
+    if (this.csel && this.csel.onkeydown.ready)
         this.csel.onkeydown.sendEvent( kC );
     if ( kC == LzKeys.keyCodes.tab ){
         if ( LzKeys.isKeyDown( 'shift' ) ){
@@ -158,7 +157,7 @@
 
     if ( !this.__LZskipblur ){
         this.__LZskipblur = true;
-        if (this.csel)
+        if (this.csel && this.csel.onblur.ready)
             this.csel.onblur.sendEvent( newsel );
         if ( this.__LZsfnextfocus != -1 ) {
             //we've been called again
@@ -174,7 +173,7 @@
     this.__LZskipblur = false;
     
 
-    if (newsel) {
+    if (newsel && newsel.onfocus.ready) {
       newsel.onfocus.sendEvent( newsel );
     }
     if ( this.__LZsfnextfocus != -1 ) {
@@ -184,7 +183,7 @@
         return;
     }
 
-    this.onfocus.sendEvent( newsel );
+    if (this.onfocus.ready) this.onfocus.sendEvent( newsel );
     this.__LZsfrunning = false;
     if ( this.__LZsfnextfocus != -1 ) {
         //we've been called again

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -83,5 +83,5 @@
 /** @access private */
 LzGlobalMouse.__mouseEvent = function(eventname, view) {
     if (eventname == 'onmousemove') LzGlobalMouse.__movecounter++;
-    if (LzGlobalMouse[eventname]) LzGlobalMouse[eventname].sendEvent(view);
+    if (LzGlobalMouse[eventname] && LzGlobalMouse[eventname].ready) LzGlobalMouse[eventname].sendEvent(view);
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzIdle.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzIdle.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzIdle.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -99,7 +99,7 @@
   */
 function __idleupdate () {
   var oi = LzIdle.onidle;
-  if (oi.delegateList && oi.delegateList.length) {
+  if (oi.ready) {
     oi.sendEvent( getTimer() );
   }
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzModeManager.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzModeManager.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzModeManager.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -72,7 +72,7 @@
   */
 LzModeManager.makeModal = function ( view ) {
     this.modeArray.push( view );
-    this.onmode.sendEvent( view );
+    if (this.onmode.ready) this.onmode.sendEvent( view );
     var f = LzFocus.getFocus();
     if ( f && ! f.childOf( view ) ){
         LzFocus.clearFocus();
@@ -89,7 +89,7 @@
         if ( this.modeArray[ i ] == view ){
             this.modeArray.splice( i , this.modeArray.length - i );
             var newmode = this.modeArray[ i - 1 ];
-            this.onmode.sendEvent( newmode || null );
+            if (this.onmode.ready) this.onmode.sendEvent( newmode || null );
             var f = LzFocus.getFocus();
             if ( newmode && f && ! f.childOf( newmode ) ){
                 LzFocus.clearFocus();
@@ -105,7 +105,7 @@
 LzModeManager.releaseAll = function ( ) {
     // reset array to remove all views
     this.modeArray = new Array();
-    this.onmode.sendEvent( null );
+    if (this.onmode.ready) this.onmode.sendEvent( null );
 }
 
 /**

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -306,12 +306,12 @@
         if (thisgroup) this.__LZtrackgroup(thisgroup,hitlist);
 
         if ( !hitlist.length && thisgroup && thisgroup.__LZlasthit ) {  // over no tracked views
-                if (thisgroup.__LZlasthit.onmousetrackout) thisgroup.__LZlasthit.onmousetrackout.sendEvent(thisgroup.__LZlasthit);
+                if (thisgroup.__LZlasthit.onmousetrackout && thisgroup.__LZlasthit.onmousetrackout.ready) thisgroup.__LZlasthit.onmousetrackout.sendEvent(thisgroup.__LZlasthit);
                 thisgroup.__LZlasthit = 0;
         }  else {
             var fd = this.__LZfindTopmost(hitlist);
             if ( fd &&  fd != thisgroup.__LZlasthit ) { 
-                if (thisgroup.__LZlasthit.onmousetrackout) thisgroup.__LZlasthit.onmousetrackout.sendEvent( thisgroup.__LZlasthit );
+                if (thisgroup.__LZlasthit.onmousetrackout && thisgroup.__LZlasthit.onmousetrackout.ready) thisgroup.__LZlasthit.onmousetrackout.sendEvent( thisgroup.__LZlasthit );
                  // save this found value so that we can send the onmousetrackover
                  // after ALL of the onmousetrackouts from all trackgroups are sent
                 found = true;
@@ -322,7 +322,8 @@
     } 
     if ( found ) {
         for (var i=0; i < foundviews.length; i++) {
-            foundviews[i].onmousetrackover.sendEvent( foundviews[i] );
+            var v = foundviews[i]
+            if (v.onmousetrackover.ready) v.onmousetrackover.sendEvent( v );
         }
     }
 }
@@ -337,7 +338,7 @@
     for (var i in this.__LZactivegroups) {
         var thisgroup = this.__LZactivegroups[i];
         //Debug.info('i', i, thisgroup, thisgroup.__LZlasthit, thisgroup.__LZlasthit.onmousetrackup);
-        if (thisgroup && thisgroup.__LZlasthit.onmousetrackup) thisgroup.__LZlasthit.onmousetrackup.sendEvent(this.__LZlasthit);
+        if (thisgroup && thisgroup.__LZlasthit.onmousetrackup && thisgroup.__LZlasthit.onmousetrackup.ready) thisgroup.__LZlasthit.onmousetrackup.sendEvent(this.__LZlasthit);
     }
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js	2007-07-20 01:33:20 UTC (rev 5722)
@@ -73,7 +73,7 @@
     if (! o) o = 0;
     if (o > this.__lzhistq.length - 1) o = this.__lzhistq.length;
     this.offset = o;
-    this.onoffset.sendEvent(o);
+    if (this.onoffset.ready) this.onoffset.sendEvent(o);
     
     var h = this.__lzhistq[o];
     for (var u in h) {
@@ -106,7 +106,7 @@
 LzHistory.receiveEvent = function(n, v){
     //Debug.write('got event', n, v);
     canvas[n] = v;
-    canvas['on' + n].sendEvent(v);
+    if (canvas['on' + n].ready) canvas['on' + n].sendEvent(v);
 }
 
 /**
@@ -202,7 +202,7 @@
 LzHistory.clear = function() {
     this.__lzhistq = []
     this.offset = 0;
-    this.onoffset.sendEvent(0);
+    if (this.onoffset.ready) this.onoffset.sendEvent(0);
 }
 
 Lz.__dhtmlhistoryready = true;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzKeys.js	2007-07-20 01:33:20 UTC (rev 5722)
@@ -34,9 +34,9 @@
         LzKeys.downKeysHash[k] = down;
         if (keycode) {
             if (down) {
-                LzKeys.onkeydown.sendEvent(keycode);
+                if (LzKeys.onkeydown.ready) LzKeys.onkeydown.sendEvent(keycode);
             } else {
-                LzKeys.onkeyup.sendEvent(keycode);
+                if (LzKeys.onkeyup.ready) LzKeys.onkeyup.sendEvent(keycode);
             }    
         }    
     }    
@@ -46,7 +46,7 @@
 /** @access private */
 LzKeys.__mousewheelEvent = function(delta) {
     LzKeys.mousewheeldelta = delta;
-    LzKeys.onmousewheeldelta.sendEvent(delta);
+    if (LzKeys.onmousewheeldelta.ready) LzKeys.onmousewheeldelta.sendEvent(delta);
 }
 
 LzKeys.isKeyDown = function(k) {

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -77,7 +77,7 @@
     if (! o) o = 0;
     if (o > this.__lzhistq.length - 1) o = this.__lzhistq.length;
     this.offset = o;
-    this.onoffset.sendEvent(o);
+    if (this.onoffset.ready) this.onoffset.sendEvent(o);
     
     var h = this.__lzhistq[o];
     for (var u in h) {
@@ -110,7 +110,7 @@
 LzHistory.receiveEvent = function(n, v){
     //Debug.write('got event', n, v);
     canvas[n] = v;
-    canvas['on' + n].sendEvent(v);
+    if (canvas['on' + n].ready) canvas['on' + n].sendEvent(v);
 }
 
 /**
@@ -297,7 +297,7 @@
     }
     this.__lzhistq = []
     this.offset = 0;
-    this.onoffset.sendEvent(0);
+    if (this.onoffset.ready) this.onoffset.sendEvent(0);
 }
 
 LzHistory.__initPersist();

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzKeys.as	2007-07-20 01:33:20 UTC (rev 5722)
@@ -130,7 +130,7 @@
 
         // check for IME
         if (this.downKeysHash[229] != true) {
-            this.onkeydown.sendEvent( kC );
+            if (this.onkeydown.ready) this.onkeydown.sendEvent( kC );
         }
     }
 
@@ -179,7 +179,7 @@
     for ( var k in this.downKeysHash ){
         this.downKeysArray.push( k );
     }
-    this.onkeyup.sendEvent( kC );
+    if (this.onkeyup.ready) this.onkeyup.sendEvent( kC );
 
         // Workaround for bug lpp-1830; we need to check if the shift
         // key or control keys are stuck down, use Flash isDown
@@ -545,7 +545,7 @@
   */
 mouseListener.onMouseWheel = function(d) {
     LzKeys.mousewheeldelta = d;
-    LzKeys.onmousewheeldelta.sendEvent(d);
+    if (LzKeys.onmousewheeldelta.ready) LzKeys.onmousewheeldelta.sendEvent(d);
 }
 // SWF-specific
 Mouse.addListener(mouseListener);

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -195,7 +195,7 @@
   * @access private
   */
 function __LZmouseup() {
-    this.onmouseup.sendEvent()
+    if (this.onmouseup.ready) this.onmouseup.sendEvent()
 }
 
 /**
@@ -203,7 +203,7 @@
   * @access private
   */
 function __LZmousemove() {
-    this.onmousemove.sendEvent()
+    if (this.onmousemove.ready) this.onmousemove.sendEvent()
 }
 
 /**
@@ -211,7 +211,7 @@
   * @access private
   */
 function __LZmousedown() {
-    this.onmousedown.sendEvent()
+    if (this.onmousedown.ready) this.onmousedown.sendEvent()
 }
 
 /**
@@ -412,7 +412,7 @@
 function __LZinstantiationDone (){
     this.percentcreated = 1;
     this.updatePercentCreated = null;
-    this.onpercentcreated.sendEvent( this.percentcreated );
+    if (this.onpercentcreated.ready) this.onpercentcreated.sendEvent( this.percentcreated );
 
     if ( this.initdelay > 0 ){
         LzInstantiator.halt();
@@ -438,7 +438,7 @@
     this.percentcreated = Math.max( this.percentcreated ,
                                     this.creatednodes / this.totalnodes );
     this.percentcreated = Math.min( .99 , this.percentcreated );
-    this.onpercentcreated.sendEvent( this.percentcreated );
+    if (this.onpercentcreated.ready) this.onpercentcreated.sendEvent( this.percentcreated );
 }
 
 /**
@@ -488,7 +488,7 @@
     } else {
         LzHistory.__restorehistory();
     }
-    this.oninit.sendEvent( this );
+    if (this.oninit.ready) this.oninit.sendEvent( this );
     if (this.datapath && this.datapath.__LZApplyDataOnInit) {
         this.datapath.__LZApplyDataOnInit();
     }
@@ -581,13 +581,13 @@
 function __windowResize(size) {
     if (this.__canvaswidthratio != null) {
         this.width = Math.floor(size.width * this.__canvaswidthratio);
-        this.onwidth.sendEvent(this.width);
+        if (this.onwidth.ready) this.onwidth.sendEvent(this.width);
         this.sprite.setWidth(this.width);
     }
 
     if (this.__canvasheightratio != null) {
         this.height = Math.floor(size.height * this.__canvasheightratio);
-        this.onheight.sendEvent(this.height);
+        if (this.onheight.ready) this.onheight.sendEvent(this.height);
         this.sprite.setHeight(this.height);
     }
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -292,7 +292,7 @@
     if (this.__LZcheckheight)
         this.__LZcheckheightFunction( s );
     
-    this.onaddsubview.sendEvent( s );
+    if (this.onaddsubview.ready) this.onaddsubview.sendEvent( s );
 }
 
 /**
@@ -912,7 +912,7 @@
     this.__LZhaser = resourceName == "empty";
 
     this.resource = resourceName;
-    this.onresource.sendEvent( resourceName );
+    if (this.onresource.ready) this.onresource.sendEvent( resourceName );
 
     // button appears to require this return value!!!
     return this.sprite.__LZmovieClipRef;
@@ -926,13 +926,13 @@
 function resourceload(i) {
     if ('resource' in i) {
         this.resource = i.resource;
-        this.onresource.sendEvent(i.resource);
+        if (this.onresource.ready) this.onresource.sendEvent(i.resource);
     }
 
     if (this.resourcewidth != i.width) {
         if ('width' in i) {
             this.resourcewidth = i.width;
-            this.onresourcewidth.sendEvent(i.width);
+            if (this.onresourcewidth.ready) this.onresourcewidth.sendEvent(i.width);
         }
 
         //if no setwidth, then the view is sized to the resource
@@ -946,7 +946,7 @@
     if (this.resourceheight != i.height) {
         if ('height' in i) {
             this.resourceheight = i.height;
-            this.onresourceheight.sendEvent(i.height);
+            if (this.onresourceheight.ready) this.onresourceheight.sendEvent(i.height);
         }
 
         if ( (!this.hassetheight && this.resourceheight != this.height ) ||
@@ -956,7 +956,7 @@
     }
 
     if (i.skiponload != true) {
-        this.onload.sendEvent(this);
+        if (this.onload.ready) this.onload.sendEvent(this);
     }
 }
 
@@ -968,7 +968,7 @@
     this.resourcewidth = 0;
     this.resourceheight = 0;
     this.reevaluateSize();
-    this.onerror.sendEvent();
+    if (this.onerror.ready) this.onerror.sendEvent();
 }
 
 /**
@@ -979,7 +979,7 @@
     this.resourcewidth = 0;
     this.resourceheight = 0;
     this.reevaluateSize();
-    this.ontimeout.sendEvent();
+    if (this.ontimeout.ready) this.ontimeout.sendEvent();
 }
 
 /**
@@ -992,7 +992,7 @@
 function setTotalFrames (n) {
     if ((n != null) && (this.totalframes != n)) {
         this.totalframes = n;
-        this.ontotalframes.sendEvent( this.totalframes );
+        if (this.ontotalframes.ready) this.ontotalframes.sendEvent( this.totalframes );
     }
 }
 
@@ -1038,7 +1038,7 @@
         }
 
         if ('onremovesubview' in this.immediateparent)
-            this.immediateparent.onremovesubview.sendEvent( this );
+            if (this.immediateparent.onremovesubview.ready) this.immediateparent.onremovesubview.sendEvent( this );
     }
 }
 
@@ -1087,7 +1087,7 @@
         this.visibility = "hidden";
     }
     // 
-    this.onvisibility.sendEvent( this.visibility );
+    if (this.onvisibility.ready) this.onvisibility.sendEvent( this.visibility );
 
     this.__LZupdateShown();
 }
@@ -1112,7 +1112,7 @@
         }
     }
     this.__LZupdateShown();
-    this.onvisibility.sendEvent( amVisible );
+    if (this.onvisibility.ready) this.onvisibility.sendEvent( amVisible );
 }
     
 /**
@@ -1140,7 +1140,7 @@
         if (ip && ip.__LZcheckheight)
             ip.__LZcheckheightFunction( this );
 
-        this.onvisible.sendEvent( shown );
+        if (this.onvisible.ready) this.onvisible.sendEvent( shown );
     }
 }
 
@@ -1187,7 +1187,7 @@
          this.immediateparent.__LZcheckwidthFunction( this );
 
 
-    this.onwidth.sendEvent( v );
+    if (this.onwidth.ready) this.onwidth.sendEvent( v );
 }
 
 /**
@@ -1230,7 +1230,7 @@
         this.immediateparent.__LZcheckheightFunction( this );
 
 
-    this.onheight.sendEvent( v );
+    if (this.onheight.ready) this.onheight.sendEvent( v );
 }
 
 
@@ -1244,7 +1244,7 @@
         this.sprite.setOpacity(v);
     }
     this.opacity = v;
-    this.onopacity.sendEvent( v );
+    if (this.onopacity.ready) this.onopacity.sendEvent( v );
     var coviz = this.__LZvizO;
     var newoviz = v != 0;
     if ( coviz != newoviz ){
@@ -1275,7 +1275,7 @@
     
     if (this.immediateparent.__LZcheckwidth)
         this.immediateparent.__LZcheckwidthFunction( this );
-    this.onx.sendEvent( this.x );
+    if (this.onx.ready) this.onx.sendEvent( this.x );
 }
 
 
@@ -1298,7 +1298,7 @@
     this.sprite.setY(v)
     if (this.immediateparent.__LZcheckheight)
         this.immediateparent.__LZcheckheightFunction( this );
-    this.ony.sendEvent( this.y );
+    if (this.ony.ready) this.ony.sendEvent( this.y );
 }
 
 
@@ -1314,7 +1314,7 @@
     var rrad = Math.PI /180 * this.rotation;
     this.__LZrsin = Math.sin( rrad )
     this.__LZrcos = Math.cos( rrad )
-    this.onrotation.sendEvent( v );
+    if (this.onrotation.ready) this.onrotation.sendEvent( v );
 
     if ( this.__LZhasoffset ){
         this.setX( this.x );
@@ -1362,7 +1362,7 @@
     this.xoffset = o;
     this.setX( this.x );
     this.setY( this.y );
-    this.onxoffset.sendEvent( o );
+    if (this.onxoffset.ready) this.onxoffset.sendEvent( o );
 }
 
 /**
@@ -1374,7 +1374,7 @@
     this.yoffset = o;
     this.setX( this.x );
     this.setY( this.y );
-    this.onyoffset.sendEvent( o );
+    if (this.onyoffset.ready) this.onyoffset.sendEvent( o );
 }
 
 
@@ -1686,13 +1686,13 @@
             this._xscale = scale;
         }
 
-        this.onunstretchedwidth.sendEvent( newsize );
+        if (this.onunstretchedwidth.ready) this.onunstretchedwidth.sendEvent( newsize );
     }
 
     if ( !this.hassetwidth ){
         this.width = newsize;
         this.sprite.setWidth(newsize);
-        if (this.isinited && this.onwidth) this.onwidth.sendEvent( newsize );
+        if (this.onwidth.ready && this.isinited && this.onwidth) this.onwidth.sendEvent( newsize );
 
         if (this.immediateparent.__LZcheckwidth)
             this.immediateparent.__LZcheckwidthFunction( this );
@@ -1711,13 +1711,13 @@
         }
 
         if (this.onunstretchedheight) 
-            this.onunstretchedheight.sendEvent( newsize );
+            if (this.onunstretchedheight.ready) this.onunstretchedheight.sendEvent( newsize );
     }
 
     if ( !this.hassetheight ){
         this.height = newsize;
         this.sprite.setHeight(newsize);
-        if (this.isinited && this.onheight) this.onheight.sendEvent( newsize );
+        if (this.onheight.ready && this.isinited && this.onheight) this.onheight.sendEvent( newsize );
 
         if (this.immediateparent.__LZcheckheight) 
             this.immediateparent.__LZcheckheightFunction( this );
@@ -1947,7 +1947,7 @@
   * events
   */
 function mouseevent(eventname) {
-    if (this[eventname]) this[eventname].sendEvent(this);
+    if (this[eventname] && this[eventname].ready) this[eventname].sendEvent(this);
 }    
 
 /**
@@ -2075,7 +2075,7 @@
     this.__lzcheckframe = n;
     this.frame = n;
     this.stop( n );
-    this.onframe.sendEvent(n);
+    if (this.onframe.ready) this.onframe.sendEvent(n);
 }
 
 /**
@@ -2110,7 +2110,7 @@
 function setBGColor ( bgc ) {
     this.sprite.setBGColor(bgc);
     if (bgc != null) this.bgcolor = Number(bgc);
-    this.onbgcolor.sendEvent( bgc );
+    if (this.onbgcolor.ready) this.onbgcolor.sendEvent( bgc );
 }
 
 /**
@@ -2169,7 +2169,7 @@
 function setClickable ( amclickable ){
     this.sprite.setClickable(amclickable);
     this.clickable = amclickable;
-    this.onclickable.sendEvent( amclickable );
+    if (this.onclickable.ready) this.onclickable.sendEvent( amclickable );
 
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -184,10 +184,10 @@
              this.height != this.sprite.getTextHeight() ) {
                 this.setHeight(this.sprite.getTextfieldHeight());
         }
-        this.ontext.sendEvent(value);
+        if (this.ontext.ready) this.ontext.sendEvent(value);
         return;
     }    
-    this[eventname].sendEvent(value);
+    if (this[eventname].ready) this[eventname].sendEvent(value);
 }
 
 // FIXME [2006-09-27 pbr] (LPP-2397) Uncomment 'override' when implemented
@@ -212,7 +212,7 @@
     this.setAttribute('focusable', enabled);
     this.enabled = enabled;
     this.sprite.setEnabled(enabled);
-    this.onenabled.sendEvent(enabled);
+    if (this.onenabled.ready) this.onenabled.sendEvent(enabled);
 }
 
 /**
@@ -245,13 +245,13 @@
     // recalculate height
     if (this.height < 9 || this.sizeToHeight) {
         this.height = this.sprite.getTextfieldHeight();
-        this.onheight.sendEvent();
+        if (this.onheight.ready) this.onheight.sendEvent();
         if (this.height > 0) {
             this.setHeight(this.height);
         }
     }
 
-    this.ontext.sendEvent(t);
+    if (this.ontext.ready) this.ontext.sendEvent(t);
 }
 
 function getText ( ){

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzText.lzs	2007-07-20 00:58:53 UTC (rev 5721)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzText.lzs	2007-07-20 01:33:20 UTC (rev 5722)
@@ -428,7 +428,7 @@
     if (val == null || val == '') return;
     this.sprite.setMaxLength(val);
     this.maxlength = val;
-    this.onmaxlength.sendEvent(val);
+    if (this.onmaxlength.ready) this.onmaxlength.sendEvent(val);
 }
 
 /**
@@ -439,7 +439,7 @@
     if (val == null || val == '') return;
     this.sprite.setPattern(val);
     this.pattern = val;
-    this.onpattern.sendEvent(val);
+    if (this.onpattern.ready) this.onpattern.sendEvent(val);
 }
 
 /**
@@ -665,7 +665,7 @@
         }
     }
 
-    this.ontext.sendEvent(t);
+    if (this.ontext.ready) this.ontext.sendEvent(t);
 }
 
 /**
@@ -951,31 +951,6 @@
 */
 
 /**
-  * Note: When this is called, "this" will be the Flash TextField
-  * object, not the LzText class, because this is called as a method on
-  * __LZtextclip from __LZforceScrollAttrs
-  * @access private
-  */
-function __updatefieldsize ( ){
-    if ( this.__control.scroll != this.scroll) {
-        this.__control.scroll = this.scroll;
-        this.__control.onscroll.sendEvent(this.scroll)
-    }
-    if (this.__control.maxscroll != this.maxscroll) {
-        this.__control.maxscroll = this.maxscroll;
-        this.__control.onmaxscroll.sendEvent(this.maxscroll)
-    }
-    if (this.__control.hscroll != this.hscroll) {
-        this.__control.hscroll = this.hscroll;
-        this.__control.onmaxscroll.sendEvent(this.hscroll)
-    }
-    if (this.__control.maxhscroll != this.maxhscroll) {
-        this.__control.maxhscroll = this.maxhscroll;
-        this.__control.onmaxscroll.sendEvent(this.maxhscroll)
-    }
-}
-
-/**
   * 
   */
 function setScroll (s){



More information about the Laszlo-checkins mailing list