[Laszlo-user] Newbie - Passing values between methods

Cortlandt Winters cortrah at gmail.com
Thu Mar 23 09:32:18 EST 2006


Sorry, that wasn't a complete path.

It's in Scripting=>method.

On 3/23/06, Cortlandt Winters <cortrah at gmail.com> wrote:
>
> Hi Matt,
>
> Here's the method description in the online reference. It shows the syntax
> for adding arguments to methods.
>
> http://www.laszlosystems.com/lps-3.1.1/docs/reference/index.html
>
> Definitely a good bookmark to set.
>
> Do well,
>
> -Cort
>
>
> On 3/22/06, Matt Hubbard < matt_hubbard at okcareertech.org > wrote:
> > >
> > > Hello,
> > >
> > > I am a total newbie with openlaszlo, so any help is very much
> > > appreciated.  I have a script that works with multiple datasets.  It
> > > extracts a url from the first dataset, tweaks it, and then I need to
> > > pass that value to another method that works with a different dataset.
> > > I am having problems passing the variable "baseURL" to a different
> > > method.  I confess that I do not understand how scoping is working in
> > > lzx.  Any direction would be most appreciated!  Here are the two
> > > methods
> > > I have so far.
> > >
> > > <datapointer xpath="data:/resource" oninit="processURL()">
> > >                <method name="processURL">
> > >                var c = this.xpathQuery('url/text()');
> > >                var urlArray = c.split("/");
> > >                var baseURL = '';
> > >                for(var i = 0; i &lt; urlArray.length-1; i++){
> > >                        var baseURL = baseURL +'/'+ urlArray[i];
> > >                }
> > >                return baseURL;
> > >                </method>
> > > </datapointer>
> > >
> > > <datapointer xpath="content:/resource" oninit="processContent()">
> > >                <method name="processContent">
> > >                var f = this.xpathQuery('node/img/@src');
> > >                Debug.write(f);
> > >                var swfsrc = baseURL + f;
> > >                Debug.write(swfsrc);
> > >                swf.setSource(swfsrc);
> > >                </method>
> > > </datapointer>
> > >
> > >
> > > Thanks,
> > >
> > > Matt Hubbard
> > >
> > >
> > >
> > > _______________________________________________
> > > Laszlo-user mailing list
> > > Laszlo-user at openlaszlo.org
> > > http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> > >
> >
> >
> > _______________________________________________
> > Laszlo-user mailing list
> > Laszlo-user at openlaszlo.org
> > http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060323/365211ae/attachment.html


More information about the Laszlo-user mailing list