, 습관 (stageHeight도를 이런 식으로 뭔가가
Multitouch.inputMode = MultitouchInputMode.GESTURE;
movieClip_1.addEventListener(TransformGestureEvent.GESTURE_PAN, fl_PanHandler_4);
function fl_PanHandler_4(event:TransformGestureEvent):void
{
event.currentTarget.y += event.offsetY;
if(event.currentTarget.y + event.currentTarget.height < stage.stageHeight)
event.currentTarget.y = stage.stageHeight - event.currentTarget.height;
if (event.currentTarget.y > 0)
event.currentTarget.y = 0;
}
작동해야하지만 당신은 아마 당신이 다른 화면 방향을 지원하려는 경우에 더 많은 노력을해야 할 것입니다 당신에게 정확한 독서 제공). 화면 크기보다 정확한 결과를 얻기 위해
는,이 클래스 추천 :
import flash.display.Stage;
public class Oriented
{
/**
* Returns the full screen width assuming orientation is landscape
*/
public static function landscapeScreenWidth(stage:Stage):int
{
return stage.fullScreenWidth > stage.fullScreenHeight ? stage.fullScreenWidth : stage.fullScreenHeight;
}
/**
* Returns the full screen height assuming orientation is landscape
*/
public static function landscapeScreenHeight(stage:Stage):int
{
return stage.fullScreenHeight > stage.fullScreenWidth ? stage.fullScreenWidth : stage.fullScreenHeight;
}
/**
* Returns the full screen width assuming orientation is portrait
*/
public static function portraitScreenWidth(stage:Stage):int
{
return stage.fullScreenWidth < stage.fullScreenHeight ? stage.fullScreenWidth : stage.fullScreenHeight;
}
/**
* Returns the full screen height assuming orientation is portrait
*/
public static function portraitScreenHeight(stage:Stage):int
{
return stage.fullScreenHeight < stage.fullScreenWidth ? stage.fullScreenWidth : stage.fullScreenHeight;
}
}
정말 감사합니다 그 owsome을 그리고 완벽하게 작동을! 당신은 나의 영웅이다!! –