1 Reply Latest reply: Jul 8, 2014 11:07 AM by alexrsmith RSS

    Import Flare libarries

    ronabarrett@yahoo.com

      Flare is an awesome data vizualization toolkit. Flare is a collection of ActionScript 3 classes for building a wide variety of interactive visualizations. For example, flare can be used to build basic charts, complex animations, network diagrams, treemaps, and more. Flare is written in the ActionScript 3 programming language and can be used to build visualizations that run on the web in the Adobe Flash Player. Flare applications can be built using the free Adobe Flex SDK or Adobe's Flex Builder IDE. Flare is based on prefuse, a full-featured visualization toolkit written in Java. Flare is open source software licensed under the terms of the BSD license, and can be freely used for both commercial and non-commercial purposes.

      Now, I downloaded the flare.prefuse-alpha visualization toolkit, from the flare.prefuse.org site. Following the steps in the Flare tutorial, for the life of me I can't seem to import the flare libraries into the Tuturial project within Flex Builder.

      How do you import projects into another project? I'm able to import the libraries so that they appear in the Flex Builder's Navigation pane. I go through the " Importing a libarary with another project" steps mentioned below. When I click "OK" to add a project, the project name (eg. flare.util) does not appear in the Library Path window. Further, when I use a statement to reference the library, such as import flare.animate.Tween, the FB2 compiler returns an error, "Definition flare.animate:Tween could not be found".

      Specifically, the flare tutorial states:
      " Importing Libraries
      Before proceeding, make sure you have the flare libraries loaded as projects within Flex Builder. You should have already unzipped the flare files into your main Flex Builder workspace directory. The next step is to import them into the Flex Builder environment:

      - Make sure you are in the "Flex Development" perspective.
      - Right click the navigator pane on the left.
      - Select "Import..." in the popup menu.
      - In the dialog, select "General > Existing Projects into Workspace" and click the "Next" button.
      - Use the "Select root directory" widgets to navigate to your Flex Builder workspace directory
      - You should now seen the flare projects listed in the "Projects:" panel
      - Make sure all flare.* projects are selected and then click the "Finish" button.

      You should now see all the flare projects in the Navigator pane. You can now browse the source code for each of the sub-libraries.

      Overview of the flare libraries
      Here is a quick overview of the various flare projects:
      flare.animate: animation library (depends on flare.util)
      flare.data: library for loading data sets, useful, but still under development (depends on flare.util)
      flare.demos: an application project showcasing a number of visualization demos
      flare.physics: a physics engine, useful for physical effects or force-directed layout (no dependencies)
      flare.query: a query processor for ActionScript objects (depends on flare.util)
      flare.util: a set of utility classes shared by all projects (no dependencies)
      flare.vis: the flare visualization components and operators (depends on flare.util, flare.animate, and flare.physics)

      If a project has a dependency, you will need to import all dependent projects into your application. We now describe how to do that.

      Importing a library within another project
      Now we need to adjust our project settings so that we can make use of the flare libraries. Just follow these steps:
      1. In the Navigator pane, right click the top folder of the "Tutorial" project
      2. Click "Properties" in the context menu
      3. In the resulting dialog, click "ActionScript Build Path" in the left panel (it should be the 3rd item from the top)
      4. Click the "Library path" tab in the right panel
      5. Click the "Add Project" button
      6. You should now see a list of projects, including all the flare libraries.
      7. Select "flare.util" and then click "OK"
      You've now added the flare.util libraries to your project, and can use any of the classes it provides. Repeat steps 5-7 above for the "flare.animate", "flare.physics", and "flare.vis" projects. (We will be using the flare.animate classes in this part of the tutorial, and then adding in the flare.vis classes in the next part, so we might as well import them all now). "

      My directory structure for the Tutorial project is:
      C:\Documents and Settings\Ron Barrett\My Documents\Flex Builder 2\Tutorial

      Can you help to explain to me how to import the flare libraries so that they are available to the Tutorial project?

      Man, if you can help me out with this I'd be REALLY grateful!!

      All the best,

      Ron
        • 1. Re: Import Flare libarries
          alexrsmith

          Using Flash Builder 4.7, this is how I got it to work:

           

          1) In the Navigation window (or "Package Explorer") right click the flare folder, and choose Properties.

           

          2) In the Dialog that appears, select Flex Library Compiler in the list on the left.

           

          3) Click the radio button that says "Use a specific SDK:". Then select Flex 3.6A from the dropdown.

           

          4) Click Apply. Then OK.

           

          5) Close the file, in this case I am using the Tutorial.as file that the Flare tutorial suggests. Open the file again and the error on the import line should be gone.