direction is a string. if it contains "up", you will execute
scrool.scrollup(), id "down" you will execute scrol.scrolldown(). Objects
can be accessed in an array manner instead of the traditional . way, so
you can select the property with string manipulation.
You could have done
eval("scroll.scroll"+e.getSource().direction+"()")
En/Na Robelix ha escrit:
> Hi!
>
> I need a scrollbar with buttons. So I tried to extract it from the
> ScrollPane, but I don't understand one line in the buttonListener:
>
> var buttonListener = new EventListener(this);
> buttonListener.onmousedown = function(e) {
> var scroll = e.getTarget();
> ***** scroll["scroll"+e.getSource().direction](); ******
> scroll.findDimensions();
> };
>
> can somebody tell me what exactly the marked line does?
>
> Thanx
> --
> Roland "Robelix" Obermayer
> Authorisierter Nichtdenker
> http://www.robelix.com
> [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> Fon: 0699/11542243
>
> --
> "Programming today is a race between software engineers striving to
> build bigger and better idiot-proof programs, and the Universe trying
> to produce bigger and better idiots. So far, the Universe is winning."
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-dev
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev