actionscript 3 - reference variable AS3 -
i trying create simple as3 code in flash professional cs6 references variable.
example:
var1:int = 1; varref = "var1"; (this "reference" variable, ofcourse not how it's done in as3) if (var1 == 1) { varref = 50 }
if run, try make string variable varref "var1" int of "1'. want reference variable, not variable of it's own.
a simple example of how great. (from know, object may needed, simple object example of situation great.)
i'm using class creating references : https://github.com/turbosqel/as3supportlib/blob/master/as3supportlib/src/turbosqel/data/lvar.as
its simple use , :
public var item:string = "some str"; {...} var ref:lvar = new lvar (this,"item"); trace(ref.value);// return : "some str" trace("my ref " + ref ); // return : ref str // can change on runtime : item = "new value"; trace(ref.value); // return : new value
same thing can other data type .
Comments
Post a Comment