2 Replies Latest reply on Feb 6, 2008 12:32 PM by ronabarrett@yahoo.com

    Import Flare Libraries

    ronabarrett@yahoo.com Level 1

      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 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,

        • 1. Re: Import Flare Libraries
          magicrebirth Level 1

          unable to create this part due to an internal error. Reason for the failure: Editor could not be initialized
          • 2. Re: Import Flare Libraries
            ronabarrett@yahoo.com Level 1
            Hi Magicrebirth:

            Jeff Heer, of UC Berkeley, responded to my question, which was also posted on the SourceForge Flare forum. The following is his reply, which solved my problem. The easy answer is simply to download and install FlexBuilder beta version 3.

            Sorry for your troubles! The tutorial was written and tested with Adobe
            Flex Builder 3 Beta, so one solution would be to use FB3 instead.

            Another approach may instead be to do a clean import of the projects.

            To do this, first delete the following files in each flare project:

            Next, you can manually set up each project. In Flex Development mode,
            right click in the Flex Navigator and select "New > Flex Library
            Project". Now create a new project. Flex Builder acts strangely when
            project names have a "." in them, so leave the "." out of the name. For
            example, type "flareutil" instead of "flare.util". After typing the
            name, click OK. There should now be a project named "flareutil" in the
            navigator pane.

            Now rename the project: right-click the project and select "Rename...".
            Now add the "." back into name (for example "flareutil" should become
            "flare.util"). In a warning message pops up, just dismiss it. The
            project should now have the correct name and include the files in the
            flare.util folder.

            Now we just need to setup the project settings. Right click the project
            and select "Properties". A dialog window should appear. In the list on
            the left, select "Flex Library Build Path". Under the tab "Classes",
            make sure the box next to the "flare" package is checked (all sub
            checkboxes should be checked as a result) -- this makes sure all the
            files are included with the project.

            Finally, you need to set up any project dependencies. These are
            described in the Tutorial. For example, flare.animate has a dependency
            on flare.util. To specify this, click the "Library path" tab in the
            Properties dialog. Now click "Add Project" and select the project to
            add. After you've done that, the project should appear in the "Build
            path libraries:" list. Click the "Link Type" setting under the newly
            added project reference, click the "Edit" button on the right, and
            adjust the link type to "External". Now repeat this for any other
            project dependencies.

            Repeat the above process for each of the included flare projects. The
            only difference is for flare.demos. For that project, create a new
            "ActionScript Project", NOT a "Flex Library Project".

            As you can see, this involves a bit of busy work, so switching to Flex
            Builder 3 may be simpler.

            hope that helps,