can you do setters/getter within a function...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

can you do setters/getter within a function...

justin_mills
In 2.06 I was trying something essentially along the lines of this code
but more complex, nothing to do with a button down, this is just simpler
to follow.

// not working
function test()
{
    var currentLocation( getLocation, setLocation ): Int;
    _mc.addEventListener( MouseEvent.MOUSE_DOWN, function( e: MouseEvent
){ currentLocation = 1; } );
}

I can achieve similar with

static var currentLocation( getLocation, setLocation ): Int;
function test()
{
    _mc.addEventListener( MouseEvent.MOUSE_DOWN, function( e: MouseEvent
){ currentLocation = 1; } );
}

are there plans to allow this type of manipulation in the first example
maybe with magic, for what I am doing which granted is unusual it would
be useful, it seems strange that variables can be set differently in
classes but not within functions.




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