My favorites | Sign in
Logo
                
Search
for
Updated Jan 02, 2008 by FlexibleExperiments
Labels: guide, howto, Featured
GettingStarted  
Learn how to get set up and get started with Degrafa.

Using Degrafa

Degrafa works with Flex2.0.1 and Flex3 (beta). If you don't have either of those, you can download Flex 2.0.1, or download the beta of Flex 3 from Adobe Labs.

  1. Download the latest version of the degrafa.swc from the Download page.
  2. Create a new Flex project in Flex Builder.
  3. In your Flex project, create a lib directory.
  4. Extract the degrafa.swc file from the .zip, and place it in the lib directory.
  5. Right click on the project name in the project Navigator, and select Properties.
  6. Select “Flex Build Path“ on the left.
  7. Select the “Library Path“ tab.
  8. Click the “Add SWC Folder“ button.
  9. Type in “lib“, press “OK“
  10. Press “OK“ to commit your changes.
  11. Degrafa is now available to use in your project. To use Degrafa, you need to use the proper XML Namespace: xmlns:degrafa=“http://www.degrafa.com/2007“
  12. Once the degrafa name space is added in your MXML file, you can use any of the Degrafa classes: <degrafa:Circle ... />

Comment by vsilyin, Jan 04, 2008

This instruction suits Flex3 (beta3)

but does not work with Flex2.0.1

In Flex2.0.1 (WinXP) the messages looks as follows: "X An internal build error has occurred. Please check the Error Log." "X unable to load SWC Degrafa.swc"

Is there another way of connecting this library to Flex2.0.1 ?

Comment by FlexibleExperiments, Jan 04, 2008

@vsilyin I just uploaded a version of the swc compiled with Flex 2. Apologies for any confusion.

Comment by vsilyin, Jan 04, 2008

Thanks! Library Degrafa-.1.2.zip works well in Flex 2.0.1! Now I'll be able to take part in the competition and try to win Flex3! :-)

Comment by samiha.souissi, Feb 18, 2008

I followed this process but it did not work with me I have this error:

1017: The definition of base class Locale was not found.

Could not resolve <mx:Application> to a component implementation.

unable to load SWC Degrafa.swc: multiple points

can you help me please?

Comment by charlie.hubbard, Mar 17, 2008

On the Mac when I unzip the zip file it actually recursively unzips the SWC. It results in a folder without a SWC file in it. If you open up the terminal and do:

unzip Degrafa-2.2.zip

It only unzips the initial zip which contains just the SWC. Just an idea maybe distribute the SWC without putting it in a zip since it's already a zip file. You're not really compressing it any more than it already is.

Comment by thesaj13, Mar 18, 2008

I too had this problem. The second time I unzipped the file I did get the SWC.

Comment by dcz.switcher, Apr 12, 2008

On mac, you can extract the SWC file using Stuffit Expander (free) !

Comment by mattguest, Jun 09, 2008

@charlie.hubbard I had a similar problem with another swc library. You can use Stuffit as dcz.switcher stated, but I also blogged about how to change the mac archive utility to prevent it here: http://mattguest.com/archive-utility-annoyance

Comment by chadmoone, Jul 17, 2008

@mattguest Thanks for the tip; I'd never even seen the prefs for Archive Utility :)

Comment by stalepretzel, Sep 30, 2008

How do I use Degrafa with Flex if I don't have Flex Builder?

Comment by patricklemiuex, Oct 01, 2008

Umm, get flexbuilder, why wouldn't you? Unless your a masochist!

Comment by ruslan.popov, Nov 11, 2008

How do I use Degrafa with Flex if I don't want to have Flex Builder?

Comment by spam4adam, Jan 26, 2009

I'd also like to use Degrafa with the SDK -- not Flex Builder. I think I can get by with the xml schema definition. Where can I get an XSD for Degrafa?

Comment by paul.richeard.holliday, Jun 02, 2009

In total agreement, my experience so far of "getting started" with degrafa has not been so great, ie, working out how to get .zip to .swc on a mac, is nuts ! .. please don't .zip the .swc !! very frustrating, and not a great first impression :P

Comment by jay.w.thomas, Jun 02, 2009

Without Flex Builder: here's what worked for me (OSX).

1. Download the SWC and unzip it to your current working directory. 2. Rename the unzipped folder to degrafa.swc 3. Create a test.mxml file. 4. Execute this command: mxmlc -external-library-path=degrafa.swc -runtime-shared-libraries=degrafa.swc/library.swf test.mxml

Hope it helps, good luck.

Comment by jay.w.thomas, Jun 02, 2009

BTW, here's what I used for my test.mxml file:

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application     
      xmlns:mx="http://www.adobe.com/2006/mxml" 
      xmlns:Degrafa="http://www.degrafa.com/2007"     
      layout="absolute"
>
    <Degrafa:GeometryComposition     
    graphicsTarget="{[ myCanvas ]}">     
    <Degrafa:Circle         
        radius="100"         
        centerX="120"         
        centerY="120" >         
        <Degrafa:fill>             
            <Degrafa:SolidFill                 
                color="#FFF"/>         
        </Degrafa:fill>     
    </Degrafa:Circle> 
</Degrafa:GeometryComposition>      
<mx:Canvas     
    id="myCanvas"/>
</mx:Application>

Taken from the intro here: http://www.insideria.com/2008/05/an-introduction-to-degrafa-1.html

Comment by jay.w.thomas, Jun 02, 2009

Also, just realized, reading comments above, that my Mac recursively unzipped the swc into a folder containing the library.swf file. Apparently that's not the way it's supposed to work. But the mxmlc command needs BOTH the .swc and the library.swf file -- so if the SWC isn't recursively unzipped, you'd still need to unzip it anyway to extract the library.swf file. If you follow this route, the command would probably look something like: mxmlc -external-library-path=Degrafa_Beta3.1_Flex3.swc -runtime-shared-libraries=library.swf test.mxml

Comment by pedro.sacramento, Aug 22, 2009

I always get a "Target file must be specified" error when I try something like this: mxmlc -external-library-path=degrafa.swc -runtime-shared-libraries=degrafa.swc/library.swf test.mxml Anybody knows why?

Comment by alvijee, Oct 19, 2009

It should be better to place the SWC file in the libs folder created by flex builder in application folder. I try this a lot of time and find better result then creat a folder after src folder. but anyway all tips are usefull.

Tahir Alvi


Sign in to add a comment
Hosted by Google Code