2 Replies Latest reply on May 24, 2007 3:39 AM by V__K__K

    VBox Panel & Zoom

    V__K__K
      I am struggling with a simple problem for the past 5 hours. Is anyone there to help on this?

      My MXML Structure is something like this

      <mx:Applicaion>
      <mx:Vbox id="myvb">
      <mx:Panel id="myPan"></mx:Panel>
      </mx:Vbox>
      </mx:Application>

      And through code I am creating instance of sprite object and adding a child to the panel "myPan". And I am calling ZoomIt function (code is below) to apply a zoom effect for my panel.

      private function zoomIn(o:Object,r:Boolean=false):void {
      var z:Zoom = new Zoom();
      z.target = o;
      z.easingFunction = Bounce.easeOut;
      z.duration = 1000;
      if (r) {
      z.reverse();
      }
      else {
      z.play();
      }
      }

      What is happening is the zoom is starting from 0,0 where as I need to start it from center point.

      If I apply the same effect in my Vbox zoom is starting from center point, but the problem here is I badly need to apply only in the panel.

      I tried with various parameters,styles etc. But I couldn't find any good solution to this.

      Any one??
        • 1. Re: VBox Panel &amp; Zoom
          JabbyPandaUA Level 3
          Combine mx:Zoom with mx:Move effect to achieve zooming effect relative to the center point of the object
          • 2. VBox Panel &amp; Zoom
            V__K__K Level 1
            Thanks for the response.

            I tried using both Move & Zoon but coldn't manage to do it.

            Apprently when I tried setting horizontalScrollPolicy & verticalScrollPolicy to off of VBox, the zoom played how I exactly I want.
            I don't know how this works, but it worked. :-))

            Instead of above MXML by using this

            <mx:Applicaion>
            <mx:Vbox id="myvb" hScrollPolicy="off" vScrollPolicy="off">
            <mx:Panel id="myPan"></mx:Panel>
            </mx:Vbox>
            </mx:Application>

            will zoom the panel from center point.

            Thanks