2015-01-22 8 views
0

어이 그래서 내 .swf 응용 프로그램의 크기가 appox 840X480이기 때문에 액션 스크립트 (adobe air one)를 사용하여 안드로이드 응용 프로그램을 개발 중입니다 ... 런타임시 응용 프로그램을 실행하는 안드로이드 장치의 화면 크기를 감지 할 수 있습니까? 화면 크기에 따라 ?? 그렇다면 어떻게? P.S - 저는 신참입니다. 액션 스크립트 고마워요동작 스크립트를 사용하여 런타임에 화면 크기를 결정하고 설정하는 방법은 무엇입니까?

+0

이 몇 가지 방법을 찾습니다

당신은 단지 콘텐츠를 확장하려면

은, 당신이 원하는 무엇이든 할 수있는 규모의 모드를 설정합니다. 읽기 : http://www.adobe.com/devnet/air/articles/multiple-screen-sizes.html – BadFeelingAboutThis

답변

0

기본적으로 앱이 액체 상태 (또는 반응성)가되도록 만드십시오. 당신은,

stage.addEventListener(Event.RESIZE, stageResizeHandler); 

function stageResizeHandler(e:Event):void { 
    stage.stageWidth; //how big the width is 
    stage.stageHeight; //how big the height is. 

    //so if you had a box, and you wanted it centered on the screen: 
    box.x = (stage.stageWidth - box.width) * .5; 
    box.y = (stage.stageHeight - box.height) * .5; 

    //draw a background 
    graphics.clear(); 
    graphics.beginFill(0xFF0000); 
    graphics.drawRect(0,0,stage.stageWidth, stage.stageHeight); 
    graphics.endFill(); 
} 

경우 :

  1. 설정 단계 정렬 및 확장 모드 :

    stage.scaleMode = StageScaleMode.NO_SCALE; 
    stage.align  = StageAlign.TOP_LEFT; 
    
  2. 무대에서 크기 조정 이벤트를 들어 다음과 같은 단계를 수행 디스플레이의 실제 크기를 알고 싶다면 Capabilities 클래스에서 수행 할 수 있습니다 :

    Capabilities.screenResolutionX; 
    Capabilities.screenResolutionY; 
    

    또는

    stage.fullScreenWidth; 
    stage.fullScreenHeight; 
    

    은 일반적으로하지만 어떤 도구 바/알림 바 포함되지 않습니다. ,

    stage.scaleMode = StageScaleMode.NO_BORDER; 
    //this will zoom in your app until it fills the whole screen, though it may crop it a bit if needed. 
    

    다른 크기 조절 모드를 확인하려면 here