for a data viz project, i've created an animated child symbol which changes its position on realtime basis. however, for some calculation purposes, i'm not able to keep track of the realtime position of the div through stage as it is only showing me fixed value (starting position of the child div).... can anyone help? or is there a way to make global variable which can store position value in child symbol and i can access those values on the main stage???
I would like to know how to do this as well. Anyone know how to get the position of symbols - namely child symbols?
Try these in compositionReady. Adapt the scope of your element.
var symTop = sym.$('Rectangle').css('top');
var symLeft = sym.$('Rectangle').css('left');
Then use the variable value where needed.
var position = sym.$("Rectangle").position();
console.log( "x or left: " + position.left + ", y or top: " + position.top );
var x = sym.$("Rectangle").position().left;
var y = sym.$("Rectangle").position().top;
var coord = sym.$("Rectangle").position();
sym.$("test_Text").html("x:" + coord.left + "<br>y:" + coord.top);