Okay - I just opened a LPP-5425 to track this and subsequent compiler
issues during development
(the old JIRA I had for this purpose was getting very long).
I'll work on this now.
On Feb 12, 2008, at 4:05 PM, Henry Minsky wrote:
The compiler is compiling this code with local vars in the handler
method incorrectly:
<canvas width="1000" height="600">
<handler name="oninit">
var i = 1000;
var starttime = getTimer();
while (i > 0) {
i--;
new lz.view(canvas, {x: i, y: i});
}
new lz.text(canvas,{x:0, y:20, text: 'elapsed time:
'+getTimer()});
var ctime = getTimer() - starttime;
new lz.text(canvas,{x:0, y:30, text: ('initialize new views
time: '+ctime )} );
</handler>
</canvas>
Each var is ending up as a global, i.e.,
package {
public var ctime = getTimer() - starttime;}
package {
public var i = 1000;}
and then the main app LzApplication.as looks like
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
import flash.ui.*;
import flash.text.Font;
public class LzApplication extends LFCApplication {
public function LzApplication() {
canvas = new LzCanvas({$delegates: ["oninit",
"$lzc$handle_oninit$$max$2Elzx_2_28_$m1", null],
$lzc$handle_oninit$$max$2Elzx_2_28_$m1:
/* -*- file: max.lzx#3.1 -*- */
function () {
with (this) {
while (i > 0) {
i--;
new (lz.view)(canvas, {x: i, y: i})
};
new (lz.text)(canvas, {x: 0, y: 20, text: "elapsed time: " +
getTimer()});
new (lz.text)(canvas, {x: 0, y: 30, text: "initialize new views time:
" + ctime})
}}, __LZproxied: "true", bgcolor: 16777215, embedfonts: true,
fontname: "Verdana,Vera,sans-serif", fontsize: 11, fontstyle: "plain",
height: 600, lpsbuild: "8002 /Users/hqm/openlaszlo/devildog",
lpsbuilddate: "2008-02-12T05:11:59-0500", lpsrelease: "RingDing",
lpsversion: "4.1", runtime: "swf9", width: 1000});
addChild(canvas.sprite);
canvas.initDone();
}
}
}
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
voice: 617-547-7881
email: [EMAIL PROTECTED]
www: http://www.ddanderson.com