Dynamic properties "set_xxx" is not a function error!???

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

Dynamic properties "set_xxx" is not a function error!???

Mihail Ivanchev
Hello List,

public var state(default, dynamic): MyState;

Reflect.setField(this, "set_state", function (s) { return s; });

gives me "set_state is not a function" exception no matter what I do. Some ideas please?

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

Re: Dynamic properties "set_xxx" is not a function error!???

Mihail Ivanchev
Forgot to say I compile to Flash 10. Hope someone can help me out!

On Wed, Nov 2, 2011 at 7:00 PM, Mihail Ivanchev <[hidden email]> wrote:
Hello List,

public var state(default, dynamic): MyState;

Reflect.setField(this, "set_state", function (s) { return s; });

gives me "set_state is not a function" exception no matter what I do. Some ideas please?


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

Re: Dynamic properties "set_xxx" is not a function error!???

laurence taylor
I think the actual class has to implement Dynamic for that to work.

On Wed, Nov 2, 2011 at 7:01 PM, Mihail Ivanchev <[hidden email]> wrote:
Forgot to say I compile to Flash 10. Hope someone can help me out!


On Wed, Nov 2, 2011 at 7:00 PM, Mihail Ivanchev <[hidden email]> wrote:
Hello List,

public var state(default, dynamic): MyState;

Reflect.setField(this, "set_state", function (s) { return s; });

gives me "set_state is not a function" exception no matter what I do. Some ideas please?


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


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

Re: Dynamic properties "set_xxx" is not a function error!???

Nicolas Cannasse
In reply to this post by Mihail Ivanchev
Le 02/11/2011 19:01, Mihail Ivanchev a écrit :
> Forgot to say I compile to Flash 10. Hope someone can help me out!

Try maybe adding "private var set_state:Dynamic" to your class, I think
that get_xxx and set_xxx fields are not defined and since flash classes
are sealed by default they don't allow runtime prototype extension
(unless they implements Dynamic)

Bes,t
Nicolas


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

Re: Dynamic properties "set_xxx" is not a function error!???

Mihail Ivanchev
In reply to this post by laurence taylor
It's a movie clip and it implements Dynamic explicitly.

Anyhow:

this.set_state seems to work, but Reflect doesnt O_O

On Wed, Nov 2, 2011 at 7:49 PM, Laurence Taylor <[hidden email]> wrote:
I think the actual class has to implement Dynamic for that to work.

On Wed, Nov 2, 2011 at 7:01 PM, Mihail Ivanchev <[hidden email]> wrote:
Forgot to say I compile to Flash 10. Hope someone can help me out!


On Wed, Nov 2, 2011 at 7:00 PM, Mihail Ivanchev <[hidden email]> wrote:
Hello List,

public var state(default, dynamic): MyState;

Reflect.setField(this, "set_state", function (s) { return s; });

gives me "set_state is not a function" exception no matter what I do. Some ideas please?


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


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


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