Hello. I have a plane which I’m using as a finger slider with this code which works well. It successfully moves a plane along the X axis and then generates a variable called frameNumber, which is the X position multiplied by 1000 and rounded up to the nearest integer. It works well.
I want the frameNumber variable to feed into a function that would play an animation by using the animationFrame (…) method. The animation is in a controller called camera_explode in a timeline called explode. The animation is of parts of a 3D camera moving away from each other giving an exploded view.
//slides the plane like a slider. Works well.
var fingerPosition = e.screenPosition;
var parentPosition = parent.position();
parentPosition [0] = fingerPosition [0];
//parentPosition [1] = fingerPosition [1]; Y axis not needed
parent.position(parentPosition);
//creates a variable (eventually) called frameNumber, which is essentially (fingerPosition [0] +1.3)*1000 rounded up to the next digit.
let posit:number = fingerPosition [0];
let numberFixer:number = posit + 1.3;
let frameRaw: number = numberFixer * 1000;
let frameNumber: number = Math.ceil(frameRaw);