0 Replies Latest reply on Aug 30, 2012 6:37 PM by BearTseng

    after zoom in/out to open callout is wrong position

    BearTseng

      Dear All

       

      After zoom in/out screen , i open callout.

      I'm having problems with its position


      code:

       

          <fx:Declarations>   

                <s:Callout   id="bCallout"

                        mouseDownOutside="bCallout.close()"

                        mouseUp="bCallout.close()"

                        backgroundColor="0x999999"

                        contentBackgroundAlpha="0"/>

         </fx:Declarations>

        <fx:Script>

           private function zoom_action(act:String):void {

                     var z:Number;

                      if(act=='+'){

                            z=0.25;

                      }else{

                             z=-0.25;

                      }

                      var my_matrix:Matrix = new Matrix();

                      my_matrix.scale(gr1.scaleX+z, gr1.scaleX+z);

                      gr1.transform.matrix=my_matrix;

            }

         </fx:Script>

       

        <s:Group id="gr1">

                <s:Button id="btn1"  x="24" y="50" label="btnA" click="bCallout.open(btn1)"/>

                <s:Button id="btn2"  x="100" y="100" label="btnB" click="bCallout.open(btn2)"/>

                 <s:Button id="btn3"  x="170" y="150" label="btnC" click="bCallout.open(btn3)"/>

        </s:Group>

       

        <s:Button id="zoomin" y="10" right="108" width="44" height="42" label="+" alpha="0.5"

                                      click="zoom_action('+')"/>

        <s:Button id="zoomout" y="10" right="59" width="44" height="42" label="-" alpha="0.5"

                                      click="zoom_action('-')"/>

       

      Any ideas what I'm doing wrong?