이 질문은 오래된 글이며, 아직 답변이 없기 때문에 미래의 독자를 위해 대답하고 있습니다.
당신이 당신의 단계에서 ScrollPane 구성 요소를 가지고는 큰 이미지를 표시한다고 가정, 당신은 다음과 같이 ScrollEvent을 듣고하여 가로 스크롤 (사실 모두 스크롤)을들을 수 있습니다 :
import fl.containers.ScrollPane;
import fl.events.ScrollEvent;
var img: ScrollPane = new ScrollPane(...); // Create a scroll pane for scroll event
img.source = ImgClass; // A Bitmap class containing dummy image to scroll
this.addChild(img);
img.addEventListener(ScrollEvent.SCROLL, onScroll);
function onScroll(e: ScrollEvent) {
if (e.direction === "horizontal") { // Trace only on horizontal scroll
trace("Delta: " + e.delta);
trace("Position: " + e.position);
}
}
를 입력 장치의 종류 가로로 스크롤하는 기능을 제공합니까? – Organis
뭐가 문제 야? 마우스 휠의 세로 번호 (y 축)를 사용하여 화면 항목의 수평 (x) 위치를 제어합니다 ... simples! –
내 Macbook 트랙 패드는 두 손가락으로 스크롤합니다. 위의 코드는 두 손가락 수직 스크롤링을 포착합니다. – user3383418