But we have to explicitly do a &quot;with (...) &quot; of that object to get the vars in scope. I think only other way to get globals is to have it in its own .as file at compile time like we do with various globals like the compiler flags ($swf9, etc)<div>
<br class="webkit-block-placeholder"></div><div><div>package {</div><div>public var foo = 259;</div><div>}</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder">
</div><br><div class="gmail_quote">On Tue, Apr 1, 2008 at 1:03 PM, P T Withington &lt;<a href="mailto:ptw@openlaszlo.org">ptw@openlaszlo.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I don&#39;t understand. &nbsp;Isn&#39;t global supposed to be the outermost scope and where free refs will be looked up?<div><div></div><div class="Wj3C7c"><br>
<br>
On 2008-04-01, at 11:25 EDT, Henry Minsky wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8x;border-left:1px #ccc solid;padding-left:1ex">
This code<br>
&nbsp;&lt;view id=&quot;v1&quot; &nbsp;width=&quot;100&quot; height=&quot;20&quot; bgcolor=&quot;red&quot;/&gt;<br>
&nbsp;&lt;view id=&quot;v2&quot; &nbsp;width=&quot;100&quot; height=&quot;20&quot; y=&quot;100&quot; x=&quot;${v1.x + v1.width + 20}&quot;<br>
bgcolor=&quot;blue&quot;/&gt;<br>
<br>
compiles to a constraint method:<br>
$lzc$bind_x$v2_$m10:<br>
function &nbsp;($lzc$ignore = null) {<br>
 &nbsp; this.setAttribute(&quot;x&quot;, v1.x + v1.width + 20);<br>
}<br>
<br>
<br>
$lzc$dependencies_x$v2_$m10:<br>
function &nbsp;() {<br>
 &nbsp; return [v1, &quot;x&quot;, v1, &quot;width&quot;]<br>
 &nbsp; &nbsp; &nbsp; }<br>
<br>
<br>
But nodes which have &nbsp;id&#39;s set them on the &quot;global&quot; object. So how can we<br>
expect these references to work? Did we decide we need<br>
to put with (global) {...} around all method bodies? Or have the compiler<br>
find all id&#39;s at compile timeand make real top level vars for them?<br>
<br>
-- <br>
Henry Minsky<br>
Software Architect<br>
<a href="mailto:hminsky@laszlosystems.com" target="_blank">hminsky@laszlosystems.com</a><br>
</blockquote>
<br>
</div></div></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>
</div>