Author: max
Date: 2007-07-18 13:58:55 -0700 (Wed, 18 Jul 2007)
New Revision: 5697

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
Log:
Change 20070718-maxcarlson-L by [EMAIL PROTECTED] on 2007-07-18 11:07:47 PDT
    in /Users/maxcarlson/openlaszlo/legals-clean
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix splash tag interaction with the view system

New Features:

Bugs Fixed: LPP-4212 - splash and sendToBack() on a subview of canvas causes 
"script causing movie to run slowly" error

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

Documentation:

Release Notes:

Details: LzSprite.as - Only create _root.spriteroot if it doesn't already exist.

lzpreloader.as - Create _root.spriteroot and _root.spriteroot.splash 
movieclips, storing splash in this.splashroot.  In done(), use sprite 
references and pass in this.splashroot as the movieclip reference.
    

Tests: See LPP-4212 for a test.  Was able to show/hide the splash and splash 
resources by typing 'splash.setVisible(true)' and 
'splash.lzprelresource.setVisible(false)' in the debugger.



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-18 20:12:56 UTC (rev 5696)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as   
2007-07-18 20:58:55 UTC (rev 5697)
@@ -15,13 +15,15 @@
 
 
     if (isroot) {
-        //var is = _root;
-        var is = _root.attachMovie('empty', 'spriteroot', 1000);
+        var is = _root.spriteroot;
+        if (! is) {
+            var is = _root.attachMovie('empty', 'spriteroot', 1000);
+        }
         this.__LZmovieClipRef = is;
         //is._x=5;
         //is._y=5;
         //this.setOpacity(.3);
-        this.mask = null;
+        //this.mask = null;
         
         this.__LZsvdepth = 1;
     } else {

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as   2007-07-18 
20:12:56 UTC (rev 5696)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as   2007-07-18 
20:58:55 UTC (rev 5697)
@@ -77,11 +77,15 @@
   this.name = iobj.name;
   this.hideafterinit = iobj.attrs.hideafterinit;
   var viewprops = {x: true, y: true, width: true, height: true};
+  var sr = _root.createEmptyMovieClip("spriteroot", 1000);
+  var root = sr.createEmptyMovieClip(this.name, 0);
+  this.splashroot = root;
+  //this.mydebug('new root' + this.splashroot);
   for (var i = 0; i < iobj.children.length; i++) {
     var c = iobj.children[i].attrs;
     var n = (c.name == null) ? ("child" + i) : c.name;
-    this.attachMovie(n, n, i + 1);
-    var mc = this[n];
+    root.attachMovie(n, n, i + 1);
+    var mc = root[n];
     mc.name = n;
     this.protoviews.push(mc);
 
@@ -162,15 +166,14 @@
   }
   var vis = (this.hideafterinit != true) ? true : false;
 
-  var svd = canvas.__LZsvdepth;
-  canvas.__LZsvdepth = 0;
+  var svd = canvas.sprite.__LZsvdepth;
+  canvas.sprite.__LZsvdepth = 0;
   var v = new LzView(canvas, {name:this.name, visible:vis,
                               options: {ignorelayout:true}});
-  v.sprite.setMovieClip(this);
-  canvas.__LZsvdepth = svd;
+  v.sprite.setMovieClip(this.splashroot);
+  canvas.sprite.__LZsvdepth = svd;
+  //this.mydebug('splashmc='+v);
 
-  this._visible = vis;
-
   for (var i = 0; i < this.protoviews.length; i++) {
     var mc = this.protoviews[i];
     var ratio = mc.lastframe / mc._totalframes;
@@ -178,6 +181,7 @@
                                   width: mc._width, height: mc._height,
                                   totalframes: mc._totalframes, ratio: ratio,
                                   options: {ignorelayout: true}});
+    //this.mydebug('new view='+nv);
     // If ratio is less than one, animate the remaining way using 
percentcreated
     if (ratio < 1) {
       nv.noteCreated = function (p) {


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

Reply via email to