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

Resizing/moving MovieClips to fit screen problem

Community Beginner ,
Aug 03, 2013 Aug 03, 2013

I'd like to make an Android and iOS app with Adobe AIR, but I found a problem I can't solve.

The Flash document size of the app is 800px x 600px, and I'd like to resize MovieClips to fit Android's and iOS' screens, suporting the Retina display on iOS devices.

I tried using StageDisplayState.FULL_SCREEN and StageScaleMode.SHOW_ALL, and this does seem to work with static MovieClips, so the snippet would look something like this:

import flash.system.Capabilities;

import flash.events.Event;

import flash.display.StageScaleMode;

import flash.display.StageDisplayState;

stage.addEventListener(Event.ENTER_FRAME,process);

var difN:Number = (((stage.stageHeight*stage.fullScreenWidth/stage.fullScreenHeight)-stage.stageWidth)/2);

function process(e:Event):void {

          difN = (((stage.stageHeight*stage.fullScreenWidth/stage.fullScreenHeight)-stage.stageWidth)/2);

          stage.scaleMode = StageScaleMode.SHOW_ALL;

}

stage.addEventListener(KeyboardEvent.KEY_UP,useFullScreen);

function useFullScreen(e:KeyboardEvent):void {

          if (e.ctrlKey) {

                    switch (e.keyCode) {

                              case Keyboard.M:

                                        stage.displayState = StageDisplayState.FULL_SCREEN;

                              break;

                              }

                    }

}

obj.x -= difN

However, I'd like to use classic tweens in my application, and this won't work since most of the elements are moving.

I'd like to rescale/move MovieClips so they don't look distorted and every moving item moves correctly, showing all the content and trying to not make any borders. I read this article but it seems like it doesn't support classic tweens: http://www.adobe.com/devnet/air/articles/multiple-screen-sizes.html.

Thanks for the help.

TOPICS
ActionScript
743
Translate
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 ,
Aug 03, 2013 Aug 03, 2013
LATEST

1. scaleMode only has an effect when you embed your swf in an html AND you publish for a percentage.

2. you need to resize your displayobjects using code and/or in the ide.  if you open your document settings panel (modify>document) and change your stage size you are offered some scaling options.  see if any work for you.

Translate
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