metadata - "Cannot access private field" despite @:access, but only outside FlxState subclass? -


running haxe 3.2.1.

i building special needed access haxeflixel's internals, added above function needed it:

@:access(flixel.flxg.keys) 

this worked, in context of override update() in flxstate subclass.

then wanted move code higher level[1]. made new class (not subclass of anything), put code in function in new class instead, , moved @:access above new function.

the new class won't compile, saying cannot access private field playback. why this, when have same @:access metadata had working before?

[1] i.e. called via flxg.signals.preupdate run if flxstate subclass opened substate, pauses parent state's update() (which still want do.)

for "i'm not sure how working before" department:

don't use member directly in @:access(), instead use class' type. in case, flxg.keys flxkeyboard, following works:

@:access(flixel.input.keyboard.flxkeyboard) 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -