Author: ptw
Date: 2006-11-08 07:57:34 -0800 (Wed, 08 Nov 2006)
New Revision: 2432
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/lzpreloader.as
openlaszlo/trunk/demos/amazon/amazon.lzx
Log:
Change 20061106-ptw-5 by [EMAIL PROTECTED] on 2006-11-06 17:57:44 EST
in /Users/ptw/OpenLaszlo/trunk
Summary: Note instantiation progress for splash if ratio < 1
Bugs Fixed:
LPP-2942: Splash is still broken (with or without ratio)
Technical Reviewer: max (Message-ID: <[EMAIL PROTECTED]>)
QA Reviewer: mamye (pending)
Doc Reviewer: jsundman (pending)
Documentation:
The world was under the illusion that if they set the
ratio for the <splash> tag to something less than one, the first
phase of the splash animation noted load progress, while the
second phase noted instantiation progress. This was apparently
never true, and when lzpreloader was fixed to actually obey its
ratio parameter, many were disappointed. Our illustrious Chief
Architect has deemed that I should "make it so". This has been
done. I have set some bleachers up in the sun...
The documentation should be updated to reflect the folk wisdom.
Details:
lzpreloader: Update/remove stale comments. Pass ratio and
totalframes to persisted views. If ratio is < 1, animate
remainder of presisted views against canvas.percentcreated.
amazon: Remove (now redundant) animation against
canvas.percentcreated.
Tests:
demos/amazon/amazon.lzx animates it's splash all the way across
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/lzpreloader.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/lzpreloader.as 2006-11-08 08:00:10 UTC
(rev 2431)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/lzpreloader.as 2006-11-08 15:57:34 UTC
(rev 2432)
@@ -5,7 +5,7 @@
//
//* A_LZ_COPYRIGHT_BEGIN ******************************************************
-//* Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
+//* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
//* Use is subject to license terms. *
//* A_LZ_COPYRIGHT_END ********************************************************
@@ -125,8 +125,9 @@
}
}
-// called by the compiler (last thing), or from
-// _root.$SID_RESOLVE_OBJECT in a kranked world
+// called by the compiler (as the last instruction in the executable),
+// this causes the transition from loading animation to construction
+// animation.
function done() {
//this.mydebug('done');
_root.lzpreloader._heartbeat.removeMovieClip();
@@ -138,8 +139,6 @@
mc.gotoAndStop(mc.lastframe);
//this.mydebug('lastframe='+mc.lastframe);
}
- // Don't create the view version of this if kranking, it will be
- // (re-)created when done is called by _root.$SID_RESOLVE_OBJECT
var vis = (this.hideafterinit != true) ? true : false;
var svd = _root.canvas.__LZsvdepth;
@@ -153,9 +152,18 @@
for (var i = 0; i < this.protoviews.length; i++) {
var mc = this.protoviews[i];
+ var ratio = mc.lastframe / mc._totalframes;
var nv = new _root.LzView(v, {name: mc.name, x: mc._x, y: mc._y,
width: mc._width, height: mc._height,
+ totalframes: mc._totalframes, ratio: ratio,
options: {ignorelayout: true}});
+ // If ratio is less than one, animate the remaining way using
percentcreated
+ if (ratio < 1) {
+ nv.noteCreated = function (p) {
+ this.stop(Math.floor(this.totalframes * (this.ratio +
(1-this.ratio)*p)));
+ };
+ var del = new _root.LzDelegate(nv, 'noteCreated', _root.canvas,
'onpercentcreated');
+ }
nv.setMovieClip(mc);
mc._visible = true;
}
Modified: openlaszlo/trunk/demos/amazon/amazon.lzx
===================================================================
--- openlaszlo/trunk/demos/amazon/amazon.lzx 2006-11-08 08:00:10 UTC (rev
2431)
+++ openlaszlo/trunk/demos/amazon/amazon.lzx 2006-11-08 15:57:34 UTC (rev
2432)
@@ -95,12 +95,6 @@
<!-- Give user a chance to see the splash at 100% -->
<attribute name="initdelay" value="400" />
-
- <!-- Continue to animate splash for created progress -->
- <method event="onpercentcreated" args="p">
- var sa = canvas.splash.splash_anim;
- sa.stop(Math.floor(sa.totalframes * (1+p)/2));
- </method>
<!-- End of Splash -->
<view width="${parent.width}">
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins