8 Replies Latest reply on Aug 13, 2013 6:58 AM by escargo

    Position Symbol based on stage or some other way?

    escargo Level 1

      I tried to look this up, but I am not finding a way to do it. I am thinking this is an easy thing to do, but I am learning Edge.


      I am trying to move a draggable image much larger than my current stage size. When you drag the image around, there are various items to click on. When you click on an item, the code I am trying use places a symbol object to be positioned a few pixels from the left and top edges of the stage no matter where the draggable image is positioned. Ultimately, having the object centered in the middle of the stage would be the best.


      Here is what I have so far in a Click event for one of the buttons on the big draggable symbol. Please excuse perhaps the wrong syntax here because I am guessing in some cases, but I think you get the idea and I am not sure I am concatenating right either:


      var positionLeft = sym.$('Stage').left();    <-- is this even an attribute you can get?

      var positionTop = sym.$('Stage').right();

      var positionLeftResolved = positionLeft + 10;    <-- there is probably a way to put this into the earlier line

      var positionTopResolved = positionRight + 10;


      var overlayBoxPosition = sym.createChildSymbol("overlayBoxSymbol", "Stage").getSymbolElement();

      overlayBoxPosition.css({"position": "relative",  "top" : "positionLeftResolved" + px, "left": "positionTopResolved" + px });


      Given the fact that I have a big draggable symbol, is this the proper way to be going about it anyway?


      Thanks for help.