Setting a variable that I can call it's value from any symbol.
hey everyone!
i'm working on edge animate game , i'm learning go can
the way have set have container holds different symbols depending on button click on. symbols open deeper part of game.
however want able set variable on stage can later manipulate when different symbols open.
what have far limited understaning of jquery, in stage start off setting variable
var variable1 = 5,
variable2 = 10;
then in symbol want able this
if(variable1 > variable2) {
then something
}
else {
then else
}
}
variable1 = 10
variable2 = 5
however problem having when set variable value in stage entire variable name , value not rememembered in symbols.
so there code write in symbols can call variables defined in stage symbols.
thank help. appreciated .
hi, i've literally solved problem myself! i've been unable variables remembered within symbols too. familiar if you've accessed stage within symbol already, (this kind-of takes step , takes main stage within symbol):
sym.getcomposition().getstage().$("anelement").hide();
the way i've updated score (displayed on stage) within symbol variable stage:
var score = sym.getcomposition().getstage().getvariable("score");
score += 100;
sym.getcomposition().getstage().$("valuedisplay").html(score);
sym.getcomposition().getstage().setvariable("score", score);
so i'd recommend:
var variable1 = sym.getcomposition().getstage().getvariable("variable1");
var variable2 = sym.getcomposition().getstage().getvariable("variable");
if(variable1 > variable2) { }
else { }
if wanted update variables , store them on stage, you'd similarly:
variable1++;
sym.getcomposition().getstage().setvariable("variable1", variable1")
hope helps, may not 100% , may explained better i'm learning go myself!
ray
More discussions in Edge Animate CC
adobe
Comments
Post a Comment