wck scroller world parameter

Hi Guys, hope you can help...

By setting the world parameter 'scrolling' to true and 'focusOn' to mc target, its easy to get the world to follow that target. I was wondering is there an easy way for it to only follow the target on the Y axis? So it ignores X totally, only going up and down... I just want to fix the X axis screen...

Or even better yet, is there a way to fix boundaries so that the scrolling does not Exceed < 100 or >100 etc.

Thanks in advance for your help
Rez1n
You could create your own world class that extends wck.World and override updateScroll() like so:
Code:
public class MyWorld extends wck.World {

  public override function updateScroll(e:Event = null):void {
    super.updateScroll(e);
    y = 300; // Constant Y value
    x = x > 1000 ? 1000 : x < -1000 ? -1000 : x; // x clamped between -1000 / 1000
  }
}


You could even make the -1000 / 1000 inspectable component properties so you could set them from within Flash.
Oo, that is really helpful mayobutter. How does one make the clamped values inspectable component properties?

EDIT: Got it. You have to set the Component Definition to be your class, i.e. "MyWorld." Then add this:
Code:
[Inspectable(name="scrollYMin", type=Number, defaultValue=-1000)]
var scrollYMin:Number = -1000;


There's some sort of refreshing you have to do I think, but I got this to work.

EDIT: The refreshing is opening the Component Defintion window back up and then clicking OK again. I suppose that probably recompiles?

Original thread: https://box2d.org/forum/viewtopic.php?t=5627