2011-06-16 65 views
0

在内容可缩放的情况下获得了一点柔性应用。 首先是一些代码柔性滚动剪切内容

<s:Scroller verticalScrollPolicy="on" width="100%" height="100%"> 



<s:Group scaleX="{breite}" scaleY="{hoehe}" 

     id="mapView" > <!-- zum zoomen --> 

    <s:Group horizontalCenter="0" id="kartePanel" verticalCenter="0"> 
    <images:karte height="630" width="430" /> 


     <components:akwOnMap data="{biblis}" verticalCenter="{biblis.y}" horizontalCenter="{biblis.x}" 
          scaleY="{negate}" scaleX="{negate}" toolTip="{biblis.name}"/> 



     <components:akwOnMap data="{akw2}" verticalCenter="{akw2.y}" horizontalCenter="{akw2.x}" 
          scaleY="{negate}" scaleX="{negate}" toolTip="{akw2.name}"/> 

      <components:akwView scaleX="{negate}" data="{akw2}" scaleY="{negate}" verticalCenter="20" horizontalCenter="{80}" > 
     </components:akwView> 
    </s:Group> 
</s:Group> 
</s:Scroller> 

变焦只是工作通过滑块改变值从1达3罚款。缩放的中点是容器的中心(地图)。

我的问题:当我缩放,滚动剪切组的一部分。它放大窗口?!

+0

我不知道这是如何涵盖你从前面的问题新的基础:http://stackoverflow.com/questions/6361673/scaling-in-flex-exclude-some-children。我也不确定为什么在上一个问题中,你选择了一个你认为没有用的答案。 – JeffryHouser 2011-06-16 12:21:44

+0

忘记改变我的评论,只是执行错误。现在要改变我的评论......也是现在的另一个问题。 – ABLX 2011-06-16 12:39:42

回答

1
private function checkScrolling():void 

{ 


var imgWidth:Number = mapView.width * mapView.scaleX; 
    var imgHeight:Number = mapView.height * mapView.scaleY; 

if (mapGroup.contentWidth < imgWidth || 
    mapGroup.contentHeight < imgHeight) 
{ 
    var excessW:Number = imgWidth - mapGroup.contentWidth; 
    var excessH:Number = imgHeight - mapGroup.contentHeight; 
    mapGroup.setContentSize(imgWidth, imgHeight); 
    /* 
    if (scroller.horizontalScrollBar) 
    { 
     scroller.horizontalScrollBar.minimum = -excessW; 
     scroller.horizontalScrollBar.maximum = excessW; 
     mapGroup.horizontalScrollPosition = 0; 
    } 
    */ 
    if (scroller.verticalScrollBar) 
    { 
     scroller.verticalScrollBar.minimum = -excessH; 
     scroller.verticalScrollBar.maximum = excessH; 
     mapGroup.verticalScrollPosition = 0; 
    } 

这只是正常工作。