Page 1 of 1

pui.shiftElements

Posted: Mon Feb 11, 2013 6:11 pm
by Shon
I am trying to use the pui.shiftElements function on an onLoad event.
I coded it like this:
pui.shiftElements(1800,2800,get("OFFSET"));

Where OFFSET is an onscreen variable with a valid value of -1152 at runtime. I keep getting and invalid argument popup when I run it. What am I missing? There must be a way to substitute a value in. When I hardcode the -1152, it works fine.

Re: pui.shiftElements

Posted: Tue Feb 12, 2013 3:36 pm
by Antonio
Shon,

I sent you an email on what the problem here was. For future reference (and to help anyone else who might run into this issue), I have copied my response below.

The get statement needs to get encapsulated in a “Number()” or “parseInt()” statement; it seems the value being returned by get was not an int and this is why the shiftElements was not working.

pui.shiftElements(1800,2800,Number(get(“OFFSET”))); or pui.shiftElements(1800,2800,parseInt(get(“OFFSET”), 10));