[Laszlo-dev] still confused about referencing node id's from methods

Henry Minsky henry.minsky at gmail.com
Tue Apr 1 10:26:02 PDT 2008


But we have to explicitly do a "with (...) " 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)
package {
public var foo = 259;
}




On Tue, Apr 1, 2008 at 1:03 PM, P T Withington <ptw at openlaszlo.org> wrote:

> I don't understand.  Isn't global supposed to be the outermost scope and
> where free refs will be looked up?
>
>
> On 2008-04-01, at 11:25 EDT, Henry Minsky wrote:
>
> > This code
> >  <view id="v1"  width="100" height="20" bgcolor="red"/>
> >  <view id="v2"  width="100" height="20" y="100" x="${v1.x + v1.width +
> > 20}"
> > bgcolor="blue"/>
> >
> > compiles to a constraint method:
> > $lzc$bind_x$v2_$m10:
> > function  ($lzc$ignore = null) {
> >   this.setAttribute("x", v1.x + v1.width + 20);
> > }
> >
> >
> > $lzc$dependencies_x$v2_$m10:
> > function  () {
> >   return [v1, "x", v1, "width"]
> >       }
> >
> >
> > But nodes which have  id's set them on the "global" object. So how can
> > we
> > expect these references to work? Did we decide we need
> > to put with (global) {...} around all method bodies? Or have the
> > compiler
> > find all id's at compile timeand make real top level vars for them?
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
> >
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080401/e0c21f45/attachment-0001.html


More information about the Laszlo-dev mailing list