Skip to main content
Inspiring
April 10, 2021
Answered

scale the content of my swf without changing the proportions

  • April 10, 2021
  • 2 replies
  • 358 views

Good Morning. I want to scale all the content in my application to adapt to any mobile device so that the content objects grow or shrink adapting to any screen, but without distorting. I am investigating with stage.scaleMode, but all the options they give have some problem.
I have read with with StageScaleMode.NON_SCALE, combined with a RESIZE event, you can fit all the content to the window, while maintaining the size and proportions of the individual assets.

What I really want is for the objects to adapt to any window and grow, but not distorted and not cut ... perhaps this is not possible.

Any ideas?. This is my code.

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener (Event.RESIZE, resizeListener);
function resizeListener (e:Event):void{

}

I'm putting it in the first frame of the action panel. What I think I am missing is the content of resizeListener

Thank you very much for the help.

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

    Hi.

     

    If you want your content to be truly responsive, you will need to scale and position the instances individually, just as it is done in web development and virtually any other technology today.

     

    Here is a sample:

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

     

    I hope it helps.

     

    Regards,

    JC

    2 replies

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    April 12, 2021

    Hi.

     

    If you want your content to be truly responsive, you will need to scale and position the instances individually, just as it is done in web development and virtually any other technology today.

     

    Here is a sample:

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

     

    I hope it helps.

     

    Regards,

    JC

    Inspiring
    April 12, 2021

    Thank you very much for the answers. I'll investigate properly.

    kglad
    Community Expert
    Community Expert
    April 10, 2021

    correct, you can NOT resize, maintain aspect ratio and fill the screen (unless that screen has the matching aspect ratio.