Any Ideas? 2) would be my preferred way of calling it, as 1) needing strings seems messy.
Hugh
unread,
Sep 30, 2014, 1:01:23 AM9/30/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to haxe...@googlegroups.com
Your general approach seems reasonable-ish. But it seems a bit odd to be caching factory functions, where you could instead be caching the resulting View. If "new View" call does the rendering, then I guess that is Ok. I suggest putting a trace in your render functions and see if they are getting called when you expect them to be.
The other thing is using "render==render2" could be your problem. In haxe, you need to use "Reflect.compareMethods" to do this check.
Hugh
TroyWorks
unread,
Oct 1, 2014, 1:10:09 AM10/1/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to haxe...@googlegroups.com
Hi Hugh
The project is actually a React.js/hx HTML5 output. so the code I gave was just an example to simplifiy.
The issue i think is that the target language is JS which doesn't support closure on the function scope like AS3 and likely other languages do, so only anonymous functions can be done via a function pointer. In my particular case the React.js has internal props e.g. this.props.* and this.state.* which are passed in IOC style onto the view.
I find the Reflection method with strings and getField kinda messy relative to AS3, but it's working or at least can work (still need to figure out what event system to use to complete the statemachine engine).
Thanks for the ping.
Philippe Elsass
unread,
Oct 1, 2014, 4:24:32 AM10/1/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to haxe...@googlegroups.com
I think you should provide a bit more complete example, like a mini buildable JS project where the problem can be reproduced.