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

doesn't work on a mobile screen

New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

Hello, does anyone know how to make the touch screen react to pressing an object? ? )) Here is the function for the mouse and desktop on primer (in Adobe Animated) - this.ball.on("pressmove", moveBall ); . But it doesn't work on a mobile screen. Is there an alternative? Just not a click, but a constant click on an object is read

Views

104

Translate

Translate

Report

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 , Apr 20, 2024 Apr 20, 2024

There isn't any specifically for mobile, as far as I can tell.

 

But the official documentation for CreateJS is at createjs.com.

Votes

Translate

Translate
Community Expert ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

i don't see a problem.

Votes

Translate

Translate

Report

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
New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

I'm sorry. Attached  -  fla and example code. 

I repeat. Everything works fine on a desktop with mouse controls, but does not work on a mobile device with a touch screen. Can you tell me what to do?

 

var root = this;
this.yes.visible=false;
this.ball.on("pressmove", moveBall );

function moveBall(e) {
		var p = stage.globalToLocal(e.stageX, e.stageY)
		e.currentTarget.x= p.x;
		e.currentTarget.y= p.y;
	
}

this.ball.on("pressup", dropBall);

var myN=0;

function dropBall () {
	
	if(root.ball.x>85 && root.ball.x < 1180 && root.ball.y > 65 && root.ball.y < 365 ) {
		root.ball.alpha=0.5;
		root.ball.x=root.myRect.x;
		root.ball.y=root.myRect.y;
		root.yes.visible=true;
		myN++
		if(myN>5) {
			root.ball.visible=false;
		}
	} else {
		root.ball.alpha=1;
		root.yes.visible=false;
	}
		
	
}

 

Votes

Translate

Translate

Report

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
New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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 ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

Hi.

 

Please make sure you're enabling touch interactions by calling...

createjs.Touch.enable(stage);


... in the beginning of your code.

Regards,
JC

Votes

Translate

Translate

Report

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
New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

Thank you. Please tell me, is there a link to the documentation that describes all the commands when working with canvas on a touch screen?

Votes

Translate

Translate

Report

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 ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

There isn't any specifically for mobile, as far as I can tell.

 

But the official documentation for CreateJS is at createjs.com.

Votes

Translate

Translate

Report

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
New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

https://createjs.com/demos/easeljs/draganddrop

Thanks for the link. I found an example at the link, but even here, if you emulate a mobile device, then nothing works. Tell me, is this example with flowers really possible to do on a touch screen?

Votes

Translate

Translate

Report

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
New Here ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

LATEST

thanks it worked)

Votes

Translate

Translate

Report

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 ,
Apr 20, 2024 Apr 20, 2024

Copy link to clipboard

Copied

also, you may need

 

e.currentTarget.x= p.x/stage.scaleX;
e.currentTarget.y= p.y/stage.scaleY;

Votes

Translate

Translate

Report

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