Skip to main content
Participating Frequently
Apr 7, 2016 5:40 AM UTC
Question

User input problem on publishing to Android

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

deesharm
Adobe Employee
Adobe Employee
Apr 7, 2016 6:33 AM UTC

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

Translate
ladyoflaAuthor
Participating Frequently
Apr 8, 2016 10:33 PM UTC

Thanks so much,

Translate