3
我有一個畫布,並在該畫布內有一個Vgroup.i動態圖形對象添加到該vgroup。添加超過4個圖形對象後,我啓用向上和向下箭頭。如何在flex中的畫布上添加垂直滾動?
這是我的畫布代碼。
<mx:Canvas id="canvas" width="120">
<s:VGroup id="levels" width="120"/>
</mx:Canvas>
這是整個代碼
<s:VGroup>
<s:VGroup>
<s:HGroup>
<s:Spacer width="50"/>
<s:Image id="prev" source="../assets/navPrev.png" mouseOver="arrowImageMouseOver(event)" mouseOut="arrowImageMouseOut(event)" visible="false"
buttonMode="true" click="clickUpArrow()"/>
</s:HGroup>
<mx:Canvas id="canvas" width="120">
<s:VGroup id="levels" width="120"/>
</mx:Canvas>
<s:HGroup>
<s:Spacer width="50"/>
<s:Image id="next" source="../assets/navNext.png" mouseOver="arrowImageMouseOver(event)" mouseOut="arrowImageMouseOut(event)" visible="false"
buttonMode="true" click="clickDownArrow()" />
</s:HGroup>
</s:VGroup>
</s:VGroup>
當向上和向下箭頭點擊..我想滾動canvas.How我能做到這一點?
我想這一個,但沒有奏效
private function clickUpArrow():void
{
canvas.verticalScrollPosition-=(levellength+10);
}
private function clickDownArrow():void
{
canvas.verticalScrollPosition +=(levellength+10);
}