Is this expected behavior? I have a need to build a canvas which does not show a scroll bar, but can have its vPosition programmatically set. I'd really like to avoid messing with the visible property of the private property of the canvas which represents the scroll bar, but can probably fall back on that if i absolutely need to.
Two questions, 1) is this expected behavior? 2) short of messing with private properties or other undocumented stuff, is there a workaround.
Example of this can be seen here:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="buildDummyArray()">
<mx:Label text="This is only a test"/>
<mx:Canvas id="foo" vScrollPolicy="off" height="200" >
<mx:Repeater id="rep" dataProvider="{testArray}">
<mx:Label text="{rep.currentItem}" y="{rep.currentIndex*20}" />
</mx:Repeater>
</mx:Canvas> <mx:Button label="Page Up" click="foo.vPosition-=100" /> <mx:Button label="Page Down" click="foo.vPosition+=100"/>
<mx:CheckBox id="cb" label="V Scroll Policy" click="setScrollPolicy()"/>
<mx:Script>
<![CDATA[
var testArray:Array;
function setScrollPolicy (){
if(cb.selected){
foo.vScrollPolicy = "on";
} else {
foo.vScrollPolicy = "off";
}
}
function buildDummyArray(){
testArray = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
}
]]>
</mx:Script>
</mx:Application>
