js.Event class instance vars

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

js.Event class instance vars

go2ghana
Hi,
is there a way to setup an eventhandler calling a differerent class of
my application whithout
loosing the reference to the application instance and without an
additional function/closure call?

i.e.
class B{
    function c(){
       svgRoot.addEventListener("mousemove", updateCursorPos, true);
        //works well - all instance vars are accessible in updateCursorPos
       svgRoot.addEventListener("mousemove",
application.updateCursorPos, true);
       //works not - no instance vars are accessible in
application.updateCursorPos
    }
}

Axel



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: js.Event class instance vars

jlm@justinfront.net
In as3 I sometime find 


usefull, not sure how what can be similar in haxe.

Alternatively can you not use the event eg:

    private function mousemove( e: MouseEvent ):Void
    {
var str: String = e.target.name;
   }


On 22 Dec 2008, at 13:52, Axel Huizinga wrote:

venthandler calling a differerent class of

my application whithout

loosing the reference to the application instance and without an

additional function/closure call?




--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: js.Event class instance vars

clemos
In reply to this post by go2ghana
Hi Axel

This has been discussed very recently here, and a few
solutions/insight are in this thread:
http://lists.motion-twin.com/pipermail/haxe/2008-December/021376.html

+++++++
Clément

On Mon, Dec 22, 2008 at 2:52 PM, Axel Huizinga <[hidden email]> wrote:

> Hi,
> is there a way to setup an eventhandler calling a differerent class of
> my application whithout
> loosing the reference to the application instance and without an
> additional function/closure call?
>
> i.e.
> class B{
>   function c(){
>      svgRoot.addEventListener("mousemove", updateCursorPos, true);
>       //works well - all instance vars are accessible in updateCursorPos
>      svgRoot.addEventListener("mousemove",
> application.updateCursorPos, true);
>      //works not - no instance vars are accessible in
> application.updateCursorPos
>   }
> }
>
> Axel
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org