2013-07-04 1 views
0

저는 여기에 새로운 사람입니다. GESTURE_PAN을 사용하여 플래시에서 스크롤을 만들려고하는데 문제가되는 것은 무비 클립을 스크롤 할 때와 무비 클립의 마지막 부분이 스테이지에서 스크롤을 멈추고 싶을 때입니다. Multitouch.inputMode = MultitouchInputMode.GESTURE를 사용하고 있습니다. 누군가 나를 도울 수 있습니까? 당신의 무비 클립이 무대에 직접 경우Android App 용 Flash CS에서 스크롤 만들기

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; 
} 

답변

0

, 습관 (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; 
     } 
    } 
+0

정말 감사합니다 그 owsome을 그리고 완벽하게 작동을! 당신은 나의 영웅이다!! –