vendredi 25 septembre 2015

Get string value from other class in as3

In my AS3 project, i have two classes named class 1 = Startup.as class 2 = Main.as

In Startup.as, i have this following code

static public var gameInstance:Startup = null;
public var multiplier:Number;
public var path:String;

function name():void{
multiplier = 2;
path = "String value";
Startup.gameInstance = this;
}

In Main.as

var num:Number;
function name(){
num = Startup.gameInstance.multiplier;
trace(num);
trace(Startup.gameInstance.path);
}

I Could get integer values, but not the string values.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire