Skip to main content
Inspiring
March 29, 2022
Answered

apk shows different to the emulator (position of a movieclip)

  • March 29, 2022
  • 1 reply
  • 636 views

Good Morning!. I am making an app in animate for android. I put a movieclip with this code so that it appears at the bottom in the center (the mc pruebaPie has the position at the bottom right,you can see it on the screenshot screenshot 😞

 

pruebaPie.x = stage.stageWidth;
pruebaPie.y = stage.stageHeight;

 

in debugging it works perfectly, but in the apk file the movieclip doesn't come out!!!

 

I appreciate the help very much. Thanks!

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    In mobile devices, the stage usually is scaled so you have to take this change into account.

     

    I usually store the scale when the app runs like this:

    var scale:Number = stage.stageHeight / 720; // 720 is the height of the stage set in the IDE

     

    And then if I need to get the full width I do like this:

    var fullWidth:Number = stage.stageWidth / scale;

     

    I have a sample here:

    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/as3/responsive_app_game_structure

     

    I hope this helps.

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    March 30, 2022

    Hi.

     

    In mobile devices, the stage usually is scaled so you have to take this change into account.

     

    I usually store the scale when the app runs like this:

    var scale:Number = stage.stageHeight / 720; // 720 is the height of the stage set in the IDE

     

    And then if I need to get the full width I do like this:

    var fullWidth:Number = stage.stageWidth / scale;

     

    I have a sample here:

    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/as3/responsive_app_game_structure

     

    I hope this helps.

     

    Regards,

    JC

    Inspiring
    April 3, 2022

    Hello. Your contribution has been of great help to me, thank you very much! I have understood perfectly how to place objects in space. Fantastic!
    Thank you very much again

    JoãoCésar17023019
    Community Expert
    Community Expert
    April 4, 2022

    Awesome, Joaquin!

     

    You're welcome!