I want to trigger an event that causes the ScrollPane to start scrolling up or down.
Ideally the ScrollPane would scroll continue to scroll all the way up or down unless canceled by another event.
I want to trigger an event that causes the ScrollPane to start scrolling up or down.
Ideally the ScrollPane would scroll continue to scroll all the way up or down unless canceled by another event.
Would be something like this:
this.createClassObject(mx.containers.ScrollPane, "my_sp", 10);
my_sp.setSize(360, 280);
this.createEmptyMovieClip("button_up",this.getNextHighestDepth());
this.createEmptyMovieClip("button_down",this.getNextHighestDepth());
this.createEmptyMovieClip("button_left",this.getNextHighestDepth());
this.createEmptyMovieClip("button_right",this.getNextHighestDepth());
button_up.onPress=function(){
my_sp.onEnterFrame=function(){
this.vPosition -= 5;
}
}
button_down.onPress=function(){
my_sp.onEnterFrame=function(){
this.vPosition += 5;
}
}
button_left.onPress=function(){
my_sp.onEnterFrame=function(){
this.hPosition -= 5;
}
}
button_right.onPress=function(){
my_sp.onEnterFrame=function(){
this.hPosition += 5;
}
}
//replace this with whatever event you want to use to make the scrolling stop
button_right.onRollOut = button_left.onRollOut = button_up.onRollOut = button_down.onRollOut = function(){
my_sp.onEnterFrame=undefined;
}
You'll have to check the _hmax and _vmax to make sure you don't scroll past the end of the content, where the scrollbar would naturally stop at. I don't remember off the top of my head what the names of these variables are, but if you run your program in debug mode and poke around the scrollpane instance, you should find it. It'll probably be easier if you move the built-in scrollbar to the bottom and see what variable changes, then find the one that matches and is static.