My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GettingStarted  
Learn how to get set up and get started with Degrafa.
guide, howto, Featured
Updated Feb 4, 2010 by Flexible...@gmail.com

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 vsil...@gmail.com, Jan 4, 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 project member Flexible...@gmail.com, Jan 4, 2008

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

Comment by vsil...@gmail.com, Jan 4, 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.s...@gmail.com, 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....@gmail.com, 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 thesa...@gmail.com, Mar 18, 2008

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

Comment by dcz.swit...@gmail.com, Apr 12, 2008

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

Comment by mattgu...@gmail.com, Jun 9, 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 chadmo...@gmail.com, Jul 17, 2008

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

Comment by stalepre...@gmail.com, Sep 30, 2008

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

Comment by patrickl...@gmail.com, Oct 1, 2008

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

Comment by ruslan.p...@gmail.com, Nov 11, 2008

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

Comment by spam4a...@gmail.com, 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.ric...@gmail.com, Jun 2, 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.th...@gmail.com, Jun 2, 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.th...@gmail.com, Jun 2, 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.th...@gmail.com, Jun 2, 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.sa...@gmail.com, 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 alvi...@gmail.com, 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

Comment by tfis...@gmail.com, Feb 17, 2010

What about Flex 4 ?

Comment by dre...@gmail.com, Mar 18, 2010

I used the -external-library-path and -runtime-shared-libraries arguments to the mxmlc command line, which successfully built, but still it didn't work when loaded in the browser (would show "Initializing" and stalls there.)

Eventually figured out that you don't need to unzip the .swc file, just use the following command line:

$ mxmlc -library-path+=Degrafa_Beta3?.1_Flex3.swc test.mxml

Comment by arbeitsl...@gmail.com, Mar 12, 2012

for anyone coming later to this, here's the updated URL from jay's post above:

http://www.developria.com/2008/05/an-introduction-to-degrafa-1.html


Sign in to add a comment
Powered by Google Project Hosting