1 Reply Latest reply on Jan 5, 2011 8:07 AM by Gregory Lafrance

    Springgraph problem

    FelixPaquette

      Hello! Recently I got a project at my job using Springgraph (if you don't know what it is : http://mark-shepherd.com/blog/springgraph-flex-component/), and they asked me to print the graph generated... and I have NO idea how to do this! Can you help me? I already tried resizing the component using the positions from the furthest items, but it didn't work!

       

      The main problem I have, is because when you drag around the component, you're not moving the component, but the items in it. Therefore, I can't tell if the component is at 0,0 and resize it from there!

       

      And about calculating the positions of the furthest items, I can get them, but it's always off by like 300-400 pixels and I don't know why. I looked through the code, and nowhere does it mention somethins like an offset!

       

      Do you have any idea how I could do this?

       

       

      Thank you so much!

        • 1. Re: Springgraph problem
          Gregory Lafrance Level 6

          You might need to convert between the global, local, and content coordinate systems in Flex:

           

          http://livedocs.adobe.com/flex/3/html/help.html?content=containers_intro_5.html

           

          Here are some relavant properties from that page:

           

          Property / method      Description

          contentMouseX          x position of mouse, in content coordinates of component.

          contentMouseY          y position of mouse, in content coordinates of component.

          contentToGlobal        Converts a Point object with x and y coordinates from the content coordinate system to the global coordinate system.

          contentToLocal         Converts a Point object from the content coordinate system to the local coordinate system of the component.

          globalToContent        Converts a Point object from the global coordinate system to the content coordinate system of the component.

          globalToLocal          Converts a Point object from the global coordinate system to the local coordinate system of the component.

          localToContent         Converts a Point object from the local coordinate system to the content coordinate system of the component.

          localToGlobal          Converts a Point object from the local coordinate system to the global coordinate system.

           

          If this post answers your question or helps, please mark it as such. Thanks!

          http://www.stardustsystems.com
          Adobe Flex Development and Support Services