Move a box relative to another box and display it

Seems like I’m asking one question after another, and I so appreciate the kind and helpful help I’ve been getting.
My current problem is to move the location of a “Sorry your answer is not correct” box to a location based on the location of another text box (essentially above it a short distance), then display it.
With my limited knowledge of JavaScript it looks like I need to do something like the following:
// Set variable {left} to the left position of my text box
var left = prez.object(‘txtMyBox’).left();
// Set variable {top} to the left position of my text box
var top = prez.object(‘txtMyBox’).top();
//Offset {top} variable to become a bottom position for the “sorry” box above it
var bot = top - 3;
//Move “Sorry” box to location by variables
//Show the box

I know this is terribly wrong because it simply doesn’t work and I’m just learning Javascript (day 3). Suggestions?



The code looks fine except there is no bot function in ActivePresenter API. It should be bottom. However, it seems this function doesn’t work correctly in version 7.2.5. Please use prez.object('txtSorry').top(bot - prez.object('txtSorry').height()) instead.


Ah, got it. Actually I had resolved it before you got back to me by calculating the distance between the bottom and top of the Sorry box and then positioning it by the top. I appreciate your time on this.