Copy link to clipboard
Copied
I've been trying to come up with a script to accomplish this task. I've got a script that can make an circle object move to follow the cursor. I've limited the movement from left to right, which is perfect. I've got a second script that creates a box in javascript that can mask a movie in Animate. Just can figure out how to get the two scripts to cooperate. I'm sure there is some Javascript magic that I just can't figure it out. Please help.
you're welcome.
Copy link to clipboard
Copied
make your circle the mask that reveals the pic that you want to reveal.
Copy link to clipboard
Copied
Thanks for the response. The circle does mask, but will not do a wipe.
Copy link to clipboard
Copied
does the circle move when you swipe?
Copy link to clipboard
Copied
No that's the issue
Copy link to clipboard
Copied
paste your swipe code here.
Copy link to clipboard
Copied
I will tomorrow thanks
Copy link to clipboard
Copied
sure.
Copy link to clipboard
Copied
thank you
Copy link to clipboard
Copied
here is the javascript...
createjs.Touch.enable(stage);
// the following code draws a fixed box on the stage and makes it a mask of bgmc...
var maskmc = new createjs.Shape();
maskmc.graphics.drawRect(0,0,40,50);
maskmc.x = this.bgmc.x;
maskmc.y = this.bgmc.y;
this.bgmc.mask = maskmc;
//the next code mades the object "ball" draggable on the x axis...
var root = this;
this.ball.on("pressmove", moveMask );
function moveMask(e) {
var p = stage.globalToLocal(e.stageX, e.stageY);
e.currentTarget.x = p.x;
}
OBJECTS:
movieclip background named: bgmc
movieclip circle named: ball_
Thanks for your input.
Copy link to clipboard
Copied
you're not moving your mask.
add maskmc.x=p.x to moveMask()
and now, it's not clear what the ball is for.
Copy link to clipboard
Copied
This is fantastic! The answer is so clear a moment after someone points it out! 😉 Thanks so much kglad!!!
Copy link to clipboard
Copied
you're welcome.