Skip to content

Instantly share code, notes, and snippets.

@kitschpatrol
Created September 27, 2012 19:45
Show Gist options
  • Save kitschpatrol/3796055 to your computer and use it in GitHub Desktop.
Save kitschpatrol/3796055 to your computer and use it in GitHub Desktop.
Futi's BlockInertialScroll
// Create the scroll container
var scrollTest:BlockInertialScroll = new BlockInertialScroll({
backgroundColor: Colors.GRAY,
showBackground: true,
width: 300,
height: 500,
maxSizeBehavior: BlockBase.MAX_SIZE_CLIPS_VIA_MASK,
scrollAxis: BlockInertialScroll.SCROLL_Y,
parent: this
});
// Add stuff to it
for (var i:int = 0; i < 50; i++) {
var box:Shape = new Shape();
GraphicsUtil.fillRect(box.graphics, 260, 50, Math.random() * uint.MAX_VALUE);
box.x = 20;
box.y = i * 70;
scrollTest.addChild(box);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment