Greg,

So script elements can call private methods on the class they were defined
in?

On Fri, Nov 19, 2010 at 9:24 AM, Greg Brown <[email protected]> wrote:

> > <my:MyWindow bxml:id="myWindow">
> >    <!-- Calls script function -->
> >    <PushButton buttonData="Login"
> ButtonPressListeners.buttonPressed="loginButtonPressed()"/>
> >
> >    <!-- Calls login() method on root object -->
> >    <PushButton buttonData="Login"
> ButtonPressListeners.buttonPressed="myWindow.login()"/>
> > </my:MyWindow>
> >
> > The downside is that it is not possible to call private methods this way
> - however, it could be argued that exposing higher-level operations like
> "login" via public methods promotes better design anyways.
>
> Note that, in the script case, the "loginButtonPressed()" function is
> effectively private to the page in which it is declared, so this approach
> does not break encapsulation.
>
> G
>
>

Reply via email to