Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Use (stage ScaleX;) in a movie clip is invalid.

Enthusiast ,
Sep 07, 2018 Sep 07, 2018

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();

});

890
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 09, 2018 Sep 09, 2018

that looks like a registration point problem.

Translate
Community Expert ,
Sep 08, 2018 Sep 08, 2018

that should be:

this.wt.on(...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 08, 2018 Sep 08, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2018 Sep 08, 2018

what's the problem with the message 1 code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 08, 2018 Sep 08, 2018

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
}
})

pianyi.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2018 Sep 09, 2018

that looks like a registration point problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 09, 2018 Sep 09, 2018
LATEST

There is no problem after the registration point check.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines