ScrollPane 组件内,让部分mc固定

今天遇到一个问题,让ScrollPane组件内某些元件固定不随滚动条移动。其实方法很简单。如下。

leftbar.addEventListener(ScrollEvent.SCROLL, scrollHandler);
function scrollHandler(event:ScrollEvent):void {

	switch (event.direction) {
		case ScrollBarDirection.HORIZONTAL :
			this.x=event.position;
			//trace("horizontal scroll", event.position, "of", event.currentTarget.maxHorizontalScrollPosition);
			break;
		case ScrollBarDirection.VERTICAL :
			loadMapTimeSheet.y = event.position;//loadMapTimeSheet就是固定的元件。
			// trace("vertical scroll", event.position, "of", event.currentTarget.maxVerticalScrollPosition);
			break;
	}
}

  

原文地址:https://www.cnblogs.com/wqing/p/2777804.html