actionscript 3 - Bindable(event="...") public static function -
i trying bind static function, designate binding event name , fire event static function.
[bindable(event="dataupdated")] public static function string(path:string) :string { ... } private static function updatedata() :void { //dosomthing; staticeventdispatcher.dispatchevent(new event('dataupdated')); } private static var staticeventdispatcher:eventdispatcher = new eventdispatcher();
my view not updating when event fired, there better way this?
i have tried dispatching event instance of class, added staticeventdispatcher
last resort, didn't work.
the point in if language translations within app, myclass.string('stringpath')
return translated component text. need app text updated when user changes language.
binding doesn't work static properties , methods (see question details binding static property).
in case it's better use singleton pattern resource manager , remove static
string
, updatedata
:
myclass.instance.string('stringpath')
and myclass
:
public static const instance:myclass = new myclass();
Comments
Post a Comment