• Home
  • About Me
  • AIR Central
  • AS3 Libs
  • Books
  • Flex Central
  • Resources
  • The Guru's
  •  

    Bye Bye Flex Builder

    June 6th, 2005

    Macromedia has announced that they will be joining the eclipse foundation and will create a plugin codenamed Zorn for editing mxml flex files. Official press release. I welcome this with open arms as I am already using eclipse for my flex and actionscript development using OxygenXML and the AS2 eclipse plugin.


    Installing AS2VOGenerator

    May 17th, 2005

    Open eclipse and go window -> preferences -> Hibernate Synchronizer -> Templates
    Hit New and enter template name AS2VOGenerator
    Click OK and paste the following into your editor:
    /*
    * This class has been automatically generated by the EverythingFlex ActionScipt 2 VO Generator template within Hibernate Synchronizer.
    *
    * For more information on ActionScipt 2 VO Generator template, visit The ActionScipt VO Builder page
    * at http://www.everythingflex.com/blog/index.cfm?mode=cat&category_id=CD4144E7-C396-8BD0-C102F965E978CD19
    * or contact Rich Tretola at rich@richtretola.com.
    *
    * This is the object class that relates to the ${class.AbsoluteValueObjectSignatureClassName} Java Class
    * @ignore
    */
    class ${class.AbsoluteValueObjectSignatureClassName}{
    #if ($class.Id)
    #if ($class.Id.hasExternalClass())
    public var ${class.Id.Property.Name}:Number = undefined;
    #else
    #foreach ($prop in $class.Id.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date = undefined;
    #elseif (${prop.ClassName} == “String”)
    public var ${prop.Name}:String = “”;
    #elseif (${prop.ClassName} == “Boolean” || ${prop.ClassName} == “boolean”)
    public var ${prop.Name}:Boolean = false;
    #elseif (${prop.ClassName} == “Byte” || ${prop.ClassName} == “Short” || ${prop.ClassName} == “Integer” || ${prop.ClassName} == “Long” || ${prop.ClassName} == “Float” || ${prop.ClassName} == “Double” || ${prop.ClassName} == “byte” || ${prop.ClassName} == “short” || ${prop.ClassName} == “int” || ${prop.ClassName} == “long” || ${prop.ClassName} == “float” || ${prop.ClassName} == “double”)
    public var ${prop.Name}:Number = undefined;
    #else
    // UNABLE TO MAP DATATYPE FOR CLASS ${prop.FullClassName} PLEASE TELL RICH TRETOLA (rich@richtretola.com) ABOUT THIS
    public var ${prop.Name}:${prop.FullClassName};
    #end
    #end
    #end
    #end
    #if ($class.Version)
    public var ${class.Version.Name}:${class.Version.FullClassName};
    #end
    #if ($class.Timestamp)
    public var ${class.Timestamp.Name}:Date = undefined;
    #end
    #if ($class.Properties.size() > 0)
    #foreach ($prop in $class.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date = undefined;
    #elseif (${prop.ClassName} == “String”)
    public var ${prop.Name}:String = “”;
    #elseif (${prop.ClassName} == “Boolean” || ${prop.ClassName} == “boolean”)
    public var ${prop.Name}:Boolean = false;
    #elseif (${prop.ClassName} == “Byte” || ${prop.ClassName} == “Short” || ${prop.ClassName} == “Integer” || ${prop.ClassName} == “Long” || ${prop.ClassName} == “Float” || ${prop.ClassName} == “Double” || ${prop.ClassName} == “byte” || ${prop.ClassName} == “short” || ${prop.ClassName} == “int” || ${prop.ClassName} == “long” || ${prop.ClassName} == “float” || ${prop.ClassName} == “double”)
    public var ${prop.Name}:Number = undefined;
    #else
    // UNABLE TO MAP DATATYPE FOR CLASS ${prop.FullClassName} PLEASE TELL RICH TRETOLA (rich@richtretola.com) ABOUT THIS
    public var ${prop.Name}:${prop.FullClassName};
    #end
    #end
    #end
    #if ($class.Version)
    public var ${class.Version.Name}:${class.Version.FullClassName};
    #end
    #if ($class.Timestamp)
    public var ${class.Timestamp.Name}:Date = undefined;
    #end
    #if ($class.ComponentList.size() > 0)
    #foreach ($component in $class.ComponentList)
    public var ${component.Name}:${component.AbsoluteValueObjectClassName};
    #end
    #end
    #if ($class.OneToOneList.size() > 0)
    #foreach ($prop in $class.OneToOneList)
    public var ${prop.Name}:${prop.AbsoluteSignatureClassName};
    #end
    #end
    #if ($class.ManyToOneList.size() > 0)
    #foreach ($prop in $class.ManyToOneList)
    public var ${prop.Name}:${prop.AbsoluteSignatureClassName};
    #end
    #end
    #if ($class.CollectionList.size() > 0)
    #foreach ($prop in $class.CollectionList)
    public var ${prop.Name}:Array;
    #end
    #end

    public static var registered:Boolean = Object.registerClass( “${class.AbsoluteValueObjectSignatureClassName}”, ${class.ValueObjectSignatureClassName});

    public function ${class.ValueObjectSignatureClassName}() {
    }
    }
    Enter a description if you want and then save the file

    Now right click on your project and click properties
    Select Hibernate Synchronizer and click on Template and then new
    Select the template from the list and paste ${class.ValueObjectClassName}.as as the Output name
    Browse to the place you want the files created
    Check the overwrite box and click save

    Now when you synchronize your hbm.xml files you will get both java file and as file generation.


    Eclipse for Flex Development

    May 4th, 2005

    Although I love PrimalScript for Flex development on my pc, I was looking for a development tool to use on my Mac.  I have been using eclipse for Java delopment on both pc and mac and have heard of others using it with several plugins for Flex (OxygenXML editor $$ and ActionScript 2 Plugin Free)  so I went through the setup today and documented it below.

    If you do not already have eclipse you can download it for free at eclipse.org.
    You will also need a get trial license for OxygenXML here or myEclipse here

    First we will install the OxygenXML plugin for .mxml files or you can choose the myEclipse plugin instead.

    OxygenXML Install

    1. Choose Help -> Software Updates -> Find and Install
    2. Choose Search for new features to install and click next
    3. Create a new Remote Site Name: OxygenXML URL:http://www.oxygenxml.com/InstData/Eclipse/site.xml
    4. Check the box next to the new OxygenXML remote site and click next
    5. Complete the install of the oXygen XML Editor and XSLT Debugger

    Now that the plugin has been installed and you have restarted eclipse, just complete the following.

    1. Choose Window -> Preferences -> Oxygen -> Editor -> Tag Insight -> Default
    2. Click new
    3. Namespace: http://www.macromedia.com/2003/mxml
    4. Root local name: <ANY>
    5. File name : <ANY>
    6. Schema Type: XML Scema
    7. Schema URI:  Browse to your mxml.xsd file located in your flex install root\extras\schema
    8. Move your new entry up to the top of the list
    9. Click OK
    10. Choose Workbence -> File Associations
    11. Click Add and type .mxml as the file type and hit ok
    12. Scoll the list of file types and select *.mxml
    13. Add Oxygen XML Editor as the default editor
    14. Choose Window -> Prefernces -> General -> Content Types -> Text -> XML -> Oxygen XML
    15. Click add File Type: *.mxml and click OK

    myEclipse Install (instead of Oxygen)

    1. Windows then Preferences then Workbench then File Associations
    2. Add “.mxml” and associate it to MyEclipse XML Editor
    3. Windows then Preferences then MyEclipse then Editors then XML then XML Catalog
      select User then Specific Entries and New
      enter URI= C:/Flex/extras/schema/mxml.xsd (located inside your Flex installation folder)
      enter Key Type= Namespace Name
      MyEclipse is a great addition to Eclipse, it includes plenty of plugins for J2EE and web development:
    4. Select User Specific Entries and click New
    5. Path to mxml.xsd file
    6. Name
    7. Key= http://www.macromedia.com/2003/mxml
    8. Thats it, you should now get tag insight when you are editing a .mxml file no matter which editor you decided to use.

      Now on to ActionScript .as files

      1) Download the AS2plugin from sourceforge
      2) Copy the org.asdt_0.0.7 (or current version) to the eclipse/plugins folder
      3) Restart eclipse
      4) Choose Window -> Preferences -> Workbence -> File Associations
      5) Click Add and type .as as the file type and hit ok
      6) Scoll the list of file types and select *.as
      7) Add ActionScript 2 Editor as the default editor
      8) You can go into the ActionScript 2 preferences and change the color coding, paths, templates, etc.

      You should now be able to work with both mxml and as files within eclipse.  The OxygenXML editor also does a nice job with the Hibernate xml files which I use for the backend Java delopment for Flex.  We’ll talk more about Hibernate in the near future.