Skip to main content
Participating Frequently
April 7, 2016
Question

User input problem on publishing to Android

  • April 7, 2016
  • 1 reply
  • 276 views

Gane was designed in flash to accept user input from keyboard arrow keys. When published to Android, the user has no way to manipulate objects. I'm new to Animate CC or Flash, and I would like some ideas on how to make my game work. Ideally I would like to move objects around by touching the mobile's display. An suggestions would be greatly appreciated.

Thanks so much,

This topic has been closed for replies.

1 reply

deesharm
Adobe Employee
Adobe Employee
April 7, 2016

Hi,

You can use code as below:

function movePlayer(e: Event): void {

  player.x = stage.mouseX;

  //Doesn't go off the right or left side

  if (player.x < 0) {

  player.x = 0;

  } else if (player.x > (stage.stageWidth - player.width)) {

  player.x = stage.stageWidth - player.width;

  }

}

Such type of handling in code allows us to move object by touching the mobile's display.

Thanks,

Adobe AIR Team

ladyoflaAuthor
Participating Frequently
April 8, 2016

Thanks so much,