<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">LzView(x)&nbsp;is&nbsp;probably&nbsp;not&nbsp;recognized&nbsp;as&nbsp;a&nbsp;cast,<div>but&nbsp;as&nbsp;a&nbsp;normal&nbsp;function&nbsp;call. &nbsp;I wonder if we</div><div>should support the 'as' directive so we can</div><div>recognize and elide casts.</div><div><br></div><div><div>&nbsp;&nbsp;var ip:LzView = (this.immediateparent as LzView);</div><div><br class="webkit-block-placeholder"></div><div>The semantics are similar, except that 'as' can return</div><div>null in cases where casts would throw an exception.</div><div>The alternative is to recognize all class names.</div><div><br class="webkit-block-placeholder"></div><div><div><div>On Mar 22, 2008, at 7:14 PM, Henry Minsky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The difference is in the line<br><br><br>$2);this.__LZdelayedSetters=LzView.__LZdelayedSetters;this.earlySetters=LzView.earlySetters;var $3=LzView(this.immediateparent);$3=this.immediateparent;this.mask=$3.mask;this.__makeSprite($2);if("width" in $2){<br> &nbsp; ^^^^^^^^^^^<br><br><br>$2);this.__LZdelayedSetters=LzView.__LZdelayedSetters;this.earlySetters=LzView.earlySetters;var $3=this.immediateparent;$3=this.immediateparent;this.mask=$3.mask;this.__makeSprite($2);if("width" in $2){<br> <br>So the type cast&nbsp; "LzView(...)" is getting sent through to the output, which must be confusing JS1. <br><br><br><br><br><br><div class="gmail_quote">On Sat, Mar 22, 2008 at 7:10 PM, Henry Minsky &lt;<a href="mailto:henry.minsky@gmail.com">henry.minsky@gmail.com</a>&gt; wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have been having trouble merging the the changes to LzView from swf9 back to swf8/dhtml, I keep getting a runtime<br> error in DHTML with even the simplest app that has a view in it<br><br><span><div> this.$lzsc$initialize has no properties</div><div><div><a>nc</a>()<span>LFCdhtml.js (line 39)</span></div> <div><a>(?)</a>(<a><span>This is the canvas</span> hasdatapath=<span>true</span> datapath=<span>Object</span></a><span>, </span><a><span>Object</span> pixellock=<span>true</span> selectable=<span>false</span> clip=<span>true</span></a><span></span>)<span>LFCdhtml.js (line 2556)</span></div> <div><a>(?)</a>(<a><span>This is the canvas</span> hasdatapath=<span>true</span> datapath=<span>Object</span></a><span>, </span><a><span>Object</span> pixellock=<span>true</span> selectable=<span>false</span> clip=<span>true</span></a><span></span>)<span>LFCdhtml.js (line 3303)</span></div> <div><a>(?)</a>(<a><span>This is the canvas</span> hasdatapath=<span>true</span> datapath=<span>Object</span></a><span>, </span><a><span>Object</span> bgcolor=<span>13434828</span> font=<span>Verdana,Vera,sans-serif</span></a><span>, </span><span>null</span><span>, </span><span>true</span><span></span>)<span>LFCdhtml.js (line 400)</span></div> <div><a>(?)</a>(<a><span>This is the canvas</span> hasdatapath=<span>true</span> datapath=<span>Object</span></a><span>, </span><a><span>Object</span> bgcolor=<span>13434828</span> font=<span>Verdana,Vera,sans-serif</span></a><span>, </span><span>null</span><span>, </span><span>true</span><span></span>)<span>LFCdhtml.js (line 2554)</span></div> <div><a>nc</a>()<span>LFCdhtml.js (line 39)</span></div><div><a>(?)</a>(<a><span>Object</span> attrs=<span>Object</span> name=<span>text</span></a><span>, </span><span>true</span><span></span>)<span>LFCdhtml.js (line 577)</span></div> <div><a>(?)</a>(<span><span>[</span><a><span>This is the canvas</span> hasdatapath=<span>true</span> datapath=<span>Object</span></a><span>, </span><span><span>[</span><a><span>Object</span> attrs=<span>Object</span> name=<span>view</span></a><span></span><span>]</span></span><span></span><span>]</span></span><span>, </span><span>500</span><span></span>)<span>LFCdhtml.js (line 6654)</span></div> <div><a>(?)</a>()<span>LFCdhtml.js (line 6642)</span></div><div><a>(?)</a>(<span>132</span><span></span>)<span>LFCdhtml.js (line 925)</span></div> <div><a>__idleupdate</a>()<span>LFCdhtml.js (line 7387)</span></div><div><a>__update</a>()<span>LFCdhtml.js (line 953)</span></div> </div><div><img title="Break on this error"><span>this.$lzsc$initialize.apply(this,arguments)<br><br> I tracked it down to this line in LzView's construct method<br><br><br><br>&nbsp;&nbsp; var ip:LzView = LzView(this.immediateparent);<br><br>If I change that to not use type casting, it works:<br><br><br>&nbsp;&nbsp;&nbsp; //var ip = this.immediateparent;<br> <br>Here's the diff in the DHTML LFC file which is produced by this change:<br><br>*** /tmp/good&nbsp;&nbsp;&nbsp; 2008-03-22 19:01:37 -0400<br>--- /tmp/bad&nbsp;&nbsp;&nbsp; 2008-03-22 19:02:01 -0400<br>***************<br>*** 2553,2560 ****<br>&nbsp; $4=null<br> &nbsp; };(arguments.callee.superclass?arguments.callee.superclass.prototype["$lzsc$initialize"]:this.nextMethod(arguments.callee,"$lzsc$initialize")).call(this,$1,$2,$3,$4)<br>&nbsp; },"animators",void 0,"_height",void 0,"_width",void 0,"_y",void 0,"_x",void 0,"_resource",void 0,"__LZhaser",void 0,"onaddsubview",LzDeclaredEvent,"onbgcolor",LzDeclaredEvent,"onblur",LzDeclaredEvent,"onclick",LzDeclaredEvent,"onclickable",LzDeclaredEvent,"onfocus",LzDeclaredEvent,"onframe",LzDeclaredEvent,"onheight",LzDeclaredEvent,"onimload",LzDeclaredEvent,"onkeyup",LzDeclaredEvent,"onkeydown",LzDeclaredEvent,"onlastframe",LzDeclaredEvent,"onload",LzDeclaredEvent,"onloadperc",LzDeclaredEvent,"onerror",LzDeclaredEvent,"ontimeout",LzDeclaredEvent,"onmousedown",LzDeclaredEvent,"onmouseout",LzDeclaredEvent,"onmouseover",LzDeclaredEvent,"onmousetrackover",LzDeclaredEvent,"onmousetrackup",LzDeclaredEvent,"onmouseup",LzDeclaredEvent,"onopacity",LzDeclaredEvent,"onplay",LzDeclaredEvent,"onremovesubview",LzDeclaredEvent,"onresource",LzDeclaredEvent,"onresourceheight",LzDeclaredEvent,"onresourcewidth",LzDeclaredEvent,"onrotation",LzDeclaredEvent,"onstop",LzDeclaredEvent,"ontotalframes",LzDeclaredEvent,"onunstretchedheight",LzDeclaredEvent,"onunstretchedwidth",LzDeclaredEvent,"onvisible",LzDeclaredEvent,"onvisibility",LzDeclaredEvent,"onwidth",LzDeclaredEvent,"onx",LzDeclaredEvent,"onxoffset",LzDeclaredEvent,"ony",LzDeclaredEvent,"onyoffset",LzDeclaredEvent,"ondblclick",LzDeclaredEvent,"DOUBLE_CLICK_TIME",500,"capabilities",LzSprite.prototype.capabilities,"construct",function($1,$2){<br> ! (arguments.callee.superclass?arguments.callee.superclass.prototype["construct"]:this.nextMethod(arguments.callee,"construct")).call(this,$1?$1:canvas,$2);this.__LZdelayedSetters=LzView.__LZdelayedSetters;this.earlySetters=LzView.earlySetters;var $3=this.immediateparent;$3=this.immediateparent;this.mask=$3.mask;this.__makeSprite($2);if("width" in $2){<br> &nbsp; this.hassetwidth=true;this.__LZcheckwidth=false<br>&nbsp; };if("height" in $2){<br>&nbsp; this.hassetheight=true;this.__LZcheckheight=false<br>--- 2553,2560 ----<br>&nbsp; $4=null<br>&nbsp; };(arguments.callee.superclass?arguments.callee.superclass.prototype["$lzsc$initialize"]:this.nextMethod(arguments.callee,"$lzsc$initialize")).call(this,$1,$2,$3,$4)<br> &nbsp; },"animators",void 0,"_height",void 0,"_width",void 0,"_y",void 0,"_x",void 0,"_resource",void 0,"__LZhaser",void 0,"onaddsubview",LzDeclaredEvent,"onbgcolor",LzDeclaredEvent,"onblur",LzDeclaredEvent,"onclick",LzDeclaredEvent,"onclickable",LzDeclaredEvent,"onfocus",LzDeclaredEvent,"onframe",LzDeclaredEvent,"onheight",LzDeclaredEvent,"onimload",LzDeclaredEvent,"onkeyup",LzDeclaredEvent,"onkeydown",LzDeclaredEvent,"onlastframe",LzDeclaredEvent,"onload",LzDeclaredEvent,"onloadperc",LzDeclaredEvent,"onerror",LzDeclaredEvent,"ontimeout",LzDeclaredEvent,"onmousedown",LzDeclaredEvent,"onmouseout",LzDeclaredEvent,"onmouseover",LzDeclaredEvent,"onmousetrackover",LzDeclaredEvent,"onmousetrackup",LzDeclaredEvent,"onmouseup",LzDeclaredEvent,"onopacity",LzDeclaredEvent,"onplay",LzDeclaredEvent,"onremovesubview",LzDeclaredEvent,"onresource",LzDeclaredEvent,"onresourceheight",LzDeclaredEvent,"onresourcewidth",LzDeclaredEvent,"onrotation",LzDeclaredEvent,"onstop",LzDeclaredEvent,"ontotalframes",LzDeclaredEvent,"onunstretchedheight",LzDeclaredEvent,"onunstretchedwidth",LzDeclaredEvent,"onvisible",LzDeclaredEvent,"onvisibility",LzDeclaredEvent,"onwidth",LzDeclaredEvent,"onx",LzDeclaredEvent,"onxoffset",LzDeclaredEvent,"ony",LzDeclaredEvent,"onyoffset",LzDeclaredEvent,"ondblclick",LzDeclaredEvent,"DOUBLE_CLICK_TIME",500,"capabilities",LzSprite.prototype.capabilities,"construct",function($1,$2){<br> ! (arguments.callee.superclass?arguments.callee.superclass.prototype["construct"]:this.nextMethod(arguments.callee,"construct")).call(this,$1?$1:canvas,$2);this.__LZdelayedSetters=LzView.__LZdelayedSetters;this.earlySetters=LzView.earlySetters;var $3=LzView(this.immediateparent);$3=this.immediateparent;this.mask=$3.mask;this.__makeSprite($2);if("width" in $2){<br> &nbsp; this.hassetwidth=true;this.__LZcheckwidth=false<br>&nbsp; };if("height" in $2){<br>&nbsp; this.hassetheight=true;this.__LZcheckheight=false<br><br></span></div></span><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br> <a href="mailto:hminsky@laszlosystems.com" target="_blank">hminsky@laszlosystems.com</a><br><br> </blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">--</div><div><br class="webkit-block-placeholder"></div><div>Don Anderson</div><div>Java/C/C++, Berkeley DB, systems consultant</div><div><br class="webkit-block-placeholder"></div><div>voice: 617-547-7881</div><div>email:&nbsp;<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a></div><div>www: <a href="http://www.ddanderson.com">http://www.ddanderson.com</a></div><div><br class="webkit-block-placeholder"></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br></div></div></body></html>