SharedObject: Dynamically access data


I would like to encapsulate access of a SharedObject in a class. In AS3 I could dynamically access data bits like so:

public function getValue(name : String, defaultValue : String = null) : String

However the access with [name] does not seem to be possible in Haxe. The compiler says: Cookie.hx:99: characters 38-42 : String should be Int

How can I get a similar behavior in Haxe?

Thanks in advance,

Try return Reflect.getProperty(, name);

1 Like