Copy link to clipboard
Copied
I use it in the scene (evt stagex/stage ScaleX;) to get the right position.
But when I use it in a movie clip, I can't find the right place.
wt.on("pressmove", function(evt)
{
evt.currentTarget.x = evt.stageX /stage.scaleX;
evt.currentTarget.y = evt.stageY /stage.scaleY;
stage.update();
});
that looks like a registration point problem.
Copy link to clipboard
Copied
that should be:
this.wt.on(...
Copy link to clipboard
Copied
Defining variables I didn't copy it.
var wt=this.Button1;
Now the problem is to use this code in the movie clip, and the component will be away from the mouse position.
Stage. ScaleX failed.
Not used (stage. ScaleX) The same deviation.
If you're not in a movie clip, that's fine.
Copy link to clipboard
Copied
what's the problem with the message 1 code?
Copy link to clipboard
Copied
Writing in a movie clip Button1 away from the position of the mouse.
The main scene is right.
This code is used for movie clips and an error occurs
createjs.Touch.enable(stage);
stage.mouseMoveOutside = true;
wtl = this.wtl
wt = this.wt
da = this.da
wt.on("pressmove", function(evt)
{
evt.currentTarget.x = evt.stageX / stage.scaleX
evt.currentTarget.y = evt.stageY / stage.scaleY
this.feixingshou.x==evt.currentTarget.x
this.feixingshou.y==evt.currentTarget.y
stage.update();
});
wt.on("pressup", function(evt)
{
if(wt.x > da.x - 50 && wt.x < da.x + 50 && wt.y > da.y - 50 && wt.y < da.y + 50)
{
wt.x = da.x;
wt.y = da.y
}
else
{
wt.x = wtl.x;
wt.y = wtl.y
}
})
Copy link to clipboard
Copied
that looks like a registration point problem.
Copy link to clipboard
Copied
There is no problem after the registration point check.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now