Author: max
Date: 2008-03-20 17:49:39 -0700 (Thu, 20 Mar 2008)
New Revision: 8339

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
Log:
Change 20080320-maxcarlson-e by [EMAIL PROTECTED] on 2008-03-20 16:21:39 PDT
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Clean up LaszloView and the swf7-8 sprites

New Features:

Bugs Fixed: LPP-5649 - LaszloView and the swf sprite should not return 
movieclip references

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

Documentation:

Release Notes:

Details: LzTextSprite.as - Use movieclip reference directly instead of relying 
on return value of makeContainerResource().

LzInputTextSprite.as - Use movieclip reference directly instead of relying  on 
return value of makeContainerResource().

LzSprite.as - Don't return references to the container movieclip in 
setResource() or makeContainerResource().

LaszloView.lzs - Clean up setResource().  Document _resource property.

Tests: All applications run as before in swf and dhtml.



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as    
2008-03-21 00:46:28 UTC (rev 8338)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as    
2008-03-21 00:49:39 UTC (rev 8339)
@@ -34,7 +34,9 @@
     ////////////////////////////////////////////////////////////////
 
     this.masked = true;
-    var mc = this.makeContainerResource();
+    this.makeContainerResource();
+    var mc = this.__LZmovieClipRef;
+
     // create the textfield on container movieclip - give it a unique name
     var txtname = '$LzText';
     mc.createTextField( txtname, 1, 0, 0, 100, 12 );

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as     2008-03-21 
00:46:28 UTC (rev 8338)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as     2008-03-21 
00:49:39 UTC (rev 8339)
@@ -299,9 +299,6 @@
     }
 
     this.resource = resourceName;
-
-    // button appears to require this return value!!!
-    return this.__LZmovieClipRef;
 }
 
 
@@ -341,7 +338,7 @@
   */
 LzSprite.prototype.makeContainerResource = function ( ) {
     //Debug.write('LzSprite.makeContainerResource');
-    return this.setResource( "empty" );
+    this.setResource( "empty" );
 }
 
 /**

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2008-03-21 
00:46:28 UTC (rev 8338)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2008-03-21 
00:49:39 UTC (rev 8339)
@@ -32,7 +32,9 @@
     ////////////////////////////////////////////////////////////////
 
     this.masked = true;
-    var mc = this.makeContainerResource();
+    this.makeContainerResource();
+    var mc = this.__LZmovieClipRef;
+
     // create the textfield on container movieclip - give it a unique name
     var txtname = '$LzText';
     mc.createTextField( txtname, 1, 0, 0, 100, 12 );

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs       2008-03-21 
00:46:28 UTC (rev 8338)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs       2008-03-21 
00:49:39 UTC (rev 8339)
@@ -1070,6 +1070,12 @@
 }
 
 /**
+  * @access private
+  * Can be nulled by unload() to allow the same resource to be loaded again 
with setResource()
+  */
+var _resource = null;
+
+/**
   * This method associates a view with a named library element. If the
   * view's <attribute>isVisible</attribute> property is true, the
   * resource will be displayed when it is attached
@@ -1084,31 +1090,13 @@
 
 function $lzc$set_resource( resourceName ) {
     if (resourceName == null || resourceName == this._resource) return;
-    /*if (LzLoader.__LZmonitorState) {
-        Debug.monitor(this, 'isloaded');
-        Debug.monitor(this, 'play');
-        Debug.monitor(this, 'playing');
-        Debug.monitor(this, '__LZtracking');
-        //Debug.monitor(this, '__lzcheckframe');
-    }
-    if ( resourceName.indexOf('http:') == 0 || resourceName.indexOf('https:') 
== 0 ){
-        this.setSource( resourceName );
-        return;
-    }
-    //Debug.write(this.sprite);
-    */
+    this.resource = this._resource = resourceName;
 
     if (resourceName != 'empty') this.sprite.setResource(resourceName);
     
     this.__LZhaser = resourceName == "empty";
 
-    this.resource = resourceName;
     if (this.onresource.ready) this.onresource.sendEvent( resourceName );
-
-    this._resource = this.resource;
-
-    // button appears to require this return value!!!
-    return this.sprite.__LZmovieClipRef;
 }
 
 /**


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to