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

    HJGraduation.com - a Flex 2 application

    November 1st, 2007

    HJGraduation.com has been a project that I have been working on for the past 6-8 months. It is an e-commerce/brochure application for the Fine Papers and Cap & Gown divisions at Herff Jones. It is a Flex 2 application powered by LiveCycle Data Services 2.5 with Java/Hibernate on the back end. The SQL database work was done by Brent Johnson, the designer of the application was Bill Davis, all of the Flex/AS3 and Java work was done by me.

    You can also visit the application at HJGraduation.com. Only some of the high schools are enabled for e-commerce, if you would like to see an example with pricing enabled (note that Schools are turned on and off daily and these 2 were on as of today), try choosing
    Alabama / Athens / East Limestone High School
    or
    Ohio / Wadsworth / Wadsworth High School.

    Here are a few screen shots showing some of the functionality.

    School Selection Process
    spp1.jpg

    Category View:
    spp2.jpg

    Product View:
    spp3.jpg

    Package View (note the upgrade and downgrade per item choices):
    spp4.jpg

    Any mp3 music you like any mp3 music for Download. mp3 tracks
    Rock Music from everywhere around the world high-quality rock music
    If you like to find legal mp3 shop you can go to mp3adrenalin - best shop ever

    Product View (note the multiple image view thumbnails)
    spp5.jpg

    Product View (note the nested decisions that effect the image shown)
    spp6.jpg

    Product View (note the renderer used for the mini image in the combobox)
    spp7.jpg

    Cart View
    spp9.jpg

    Checkout Process
    spp10.jpg


    Artemis/Hibernate Apollo Application

    May 30th, 2007

    Well it has been a while that I have been promising to document this sample app. Here is the basis. ArtemisEmployee is an application that uses a Hibernate back end with an embedded hsqldb database to store the employee data. The UI is built with Apollo and the data streams between the Java back end and the Apollo UI via the Artemis Bridge.

    Here is the code involved in the Java back end. It is a very simple application consisting of a single bean class and a delegate for point of connection. The delegate has 2 methods for getting and Employee object and updating an Employee object.

    Here is the Employee.hbm.xml file:

    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <!-- Generated May 9, 2007 7:38:47 AM by Hibernate Tools 3.2.0.beta8 -->
    <hibernate-mapping package="com.everythingflex.artemisEmployee.vo" default-lazy="false">
        <class name="Employee" table="Employee">
            <id name="employeeId" type="int">
                <column name="EMPLOYEE_ID" />
                <generator class="assigned" />
            </id>
            <property name="firstName" type="string">
                <column name="FIRST_NAME" length="50" not-null="true" />
            </property>
            <property name="lastName" type="string">
                <column name="LAST_NAME" length="50" not-null="true" />
            </property>
            <property name="email" type="string">
                <column name="EMAIL" length="50" not-null="true" />
            </property>
            <property name="jobTitle" type="string">
                <column name="JOB_TITLE" length="50" not-null="true" />
            </property>       
        </class>
    </hibernate-mapping>

    Here is the corresponding Employee.java bean:

    package com.everythingflex.artemisEmployee.vo;

    public class Employee {

        private int employeeId;
        private String firstName;
        private String lastName;
        private String email;
        private String jobTitle;
        /**
         *
         */

        public Employee() {
            super();
            // TODO Auto-generated constructor stub
        }
        /**
         * @param employeeId
         * @param firstName
         * @param lastName
         * @param email
         * @param jobTitle
         */

        public Employee(int employeeId, String firstName, String lastName, String email, String jobTitle) {
            super();
            this.employeeId = employeeId;
            this.firstName = firstName;
            this.lastName = lastName;
            this.email = email;
            this.jobTitle = jobTitle;
        }
        /**
         * @return the email
         */

        public String getEmail() {
            return email;
        }
        /**
         * @param email the email to set
         */

        public void setEmail(String email) {
            this.email = email;
        }
        /**
         * @return the employeeId
         */

        public int getEmployeeId() {
            return employeeId;
        }
        /**
         * @param employeeId the employeeId to set
         */

        public void setEmployeeId(int employeeId) {
            this.employeeId = employeeId;
        }
        /**
         * @return the firstName
         */

        public String getFirstName() {
            return firstName;
        }
        /**
         * @param firstName the firstName to set
         */

        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }
        /**
         * @return the lastName
         */

        public String getLastName() {
            return lastName;
        }
        /**
         * @param lastName the lastName to set
         */

        public void setLastName(String lastName) {
            this.lastName = lastName;
        }
        /**
         * @return the jobTitle
         */

        public String getJobTitle() {
            return jobTitle;
        }
        /**
         * @param position the jobTitle to set
         */

        public void setJobTitle(String jobTitle) {
            this.jobTitle = jobTitle;
        }
       
       
    }

    The Delegate is the point of access between Apollo and Java. Here is the Delegate class:

    package com.everythingflex.artemisEmployee.business;

    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;

    import com.effectiveui.artemis.ArtemisBridge;
    import com.effectiveui.artemis.event.ArtemisResultEvent;
    import com.everythingflex.artemisEmployee.vo.Employee;


    public class Delegate {
       
        private SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();

        public ArtemisResultEvent getEmployee(Integer id){
            ArtemisResultEvent result = new ArtemisResultEvent();
            Session session = null;
            try{;
                session = sessionFactory.openSession();
                Employee e = (Employee) session.load(Employee.class,id);
                result.setResult(e);
            } catch (Exception E) {
                System.out.print(E);
            } finally {
                session.flush();
                session.close();
            }
            return result;
        }
       
        public ArtemisResultEvent updateEmployee(Employee employee){
            ArtemisResultEvent result = new ArtemisResultEvent();
            Session session = null;
            Transaction tx = null;
            Boolean results = true;
            try{
                session = sessionFactory.openSession();
                tx = session.beginTransaction();
                session.update(employee);
                tx.commit();
            } catch (Exception E) {
                results = false;
                System.out.print(E);
            } finally {
                tx = null;
                session.flush();
                session.close();
            }
            result.setResult(results);
            return result;
        }
       
        /**
         * @param args
         */

        public static void main(String[] args) {
            // TODO Auto-generated method stub
            ArtemisBridge.getInstance().bootstrap();
            //Delegate d = new Delegate();
            //d.getEmployee(1);
        }

    }

    OK, now for the Apollo side of the application:

    Here is the Employee ActionScript class that maps to the Java Employee class:

    package com.everythingflex.artemisEmployee.vo
    {
        [RemoteClass(alias="com.everythingflex.artemisEmployee.vo.Employee")]
        [Bindable]
        public class Employee
        {
           
            public var employeeId:int;
            public var firstName:String;
            public var lastName:String;
            public var email:String;
            public var jobTitle:String
        }
    }

    This is the bridge class that is making the connection between Apollo and Java and handling the results.

    package com.everythingflex.artemisEmployee.bridge
    {
        import com.effectiveui.artemis.mirror.ArtemisObject;
        import com.effectiveui.artemis.mirror.call.ArtemisObjectCall;
        import flash.utils.getQualifiedClassName;
        import mx.rpc.events.ResultEvent;
        import flash.events.EventDispatcher;
        import com.everythingflex.artemisEmployee.vo.Employee;
       
        public class EmployeeArtemisObject extends ArtemisObject
        {
           
            public static const LIB_ID:String = "com.everythingflex.artemisEmployee.business.Delegate";
           
            public function EmployeeArtemisObject(){
                super();
            }
                   
            public function getEmployee(employeeId:int):void{
                var artemisCall:ArtemisObjectCall = new ArtemisObjectCall(LIB_ID, "getEmployee", employeeId);
                artemisCall.addEventListener(ResultEvent.RESULT, getEmployeeResult);
                send(artemisCall);
            }
           
            public function getEmployeeResult(e:ResultEvent):void{
                EventDispatcher(e.target).removeEventListener(e.type, getEmployeeResult);
                var rEvent:ResultEvent = new ResultEvent("employeeResult", false, true, e.result);
                dispatchEvent(rEvent);
            }
           
            public function updateEmployee(employee:Employee):void{
                var artemisCall:ArtemisObjectCall = new ArtemisObjectCall(LIB_ID, "updateEmployee", employee);
                artemisCall.addEventListener(ResultEvent.RESULT, updateEmployeeResult);
                send(artemisCall);
            }
           
            public function updateEmployeeResult(e:ResultEvent):void{
                EventDispatcher(e.target).removeEventListener(e.type, updateEmployeeResult);
                var rEvent:ResultEvent = new ResultEvent("updateEmployeeResult", false, true, e.result);
                dispatchEvent(rEvent);
            }
           
        }
    }

    Finally the main Apollo application file which makes the connection to the bridge and the calls to get the Employee objects from the hsqldb and also update the Employee as well.

    <?xml version="1.0" encoding="utf-8"?>

    <mx:ApolloApplication xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="custom.*"
        creationComplete="initArtemisBridge()"
        backgroundImage="@Embed('bg.png')"
        backgroundColor="#FFFFFF" height="420" width="340" layout="absolute">


        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import com.effectiveui.artemis.mirror.call.ArtemisObjectCall;
                import mx.rpc.events.ResultEvent;
                import com.effectiveui.artemis.event.ArtemisServiceEvent;
                import com.effectiveui.artemis.ArtemisBridge;
                import com.everythingflex.artemisEmployee.vo.Employee;
                import com.everythingflex.artemisEmployee.bridge.EmployeeArtemisObject;
               
                private var bridge:ArtemisBridge = ArtemisBridge.getInstance();
                private var employeeArtemisObject:EmployeeArtemisObject;
                [Bindable]
                private var isBridgeStarted:Boolean = false;
                [Bindable]
                private var updateEnabled:Boolean = false;
               
                [Bindable]
                private var employee:Employee;
               
                private function initArtemisBridge():void{
                    ti.text = "Bridge Not Running \n";
                    bridge.startServer();
                    bridge.addEventListener(ArtemisServiceEvent.ARTEMIS_STARTED, bridgeStarted);
                    employeeArtemisObject = new EmployeeArtemisObject();
                    employeeArtemisObject.addEventListener("employeeResult", employeeResult);
                    employeeArtemisObject.addEventListener("updateEmployeeResult", updateEmployeeResult);
                }
                private function bridgeStarted(e:ArtemisServiceEvent):void{
                    ti.text += "Bridge Started \n";
                    isBridgeStarted = true;
                }
               
                private function getEmployee():void{
                    ti.text += "getEmployee(" + employeeId.value + ") \n";
                    ti.verticalScrollPosition += 50;
                    employeeArtemisObject.getEmployee(employeeId.value);
                }
               
                private function employeeResult(_employee:ResultEvent):void{
                    employee = Employee(_employee.result);
                    if(employee.employeeId > 0){
                        updateEnabled = true;
                    }
                }
               
                private function updateEmployee(employee:Employee):void{
                    ti.text += "updateEmployee(" + employee + ") \n";
                    ti.verticalScrollPosition += 75;
                    employee.firstName = firstName.text;
                    employee.lastName = lastName.text;
                    employee.email = email.text;
                    employee.jobTitle = jobTitle.text;
                    employeeArtemisObject.updateEmployee(employee);
                }
               
                private function updateEmployeeResult(status:ResultEvent):void{
                    if(status.result){
                        ti.text += "update successful \n";
                    } else {
                        ti.text += "update failed \n";
                    }
                }
               
               
            ]]>
        </mx:Script>
        <mx:Style>
            TextArea {
                backgroundAlpha: .2;
                color: #FFFFFF;
            }
            TextInput {
                backgroundAlpha: .2;
                color: #FFFFFF;
            }
            Label {
                color: #FFFFFF;
            }
        </mx:Style>
        <mx:TextArea id="ti" width="300" height="189" x="19" y="33"/>
        <mx:NumericStepper minimum="1" maximum="9" id="employeeId" stepSize="1" x="151.5" y="230" enabled="{isBridgeStarted}" width="45"/>
        <mx:Button click="getEmployee()" label="Load Employee" x="207" y="230" enabled="{isBridgeStarted}"/>
        <mx:Label x="19" y="232" text="Search by EmpoyeeId:"/>
        <mx:Label x="19" y="260" text="First Name:"/>
        <mx:Label x="19" y="286" text="Last Name:"/>
        <mx:Label x="19" y="312" text="Email:"/>
        <mx:Label x="19" y="340" text="Job Title:"/>
        <mx:TextInput x="89" y="284" id="lastName" text="{employee.lastName}" width="230"/>
        <mx:TextInput x="89" y="258" id="firstName" text="{employee.firstName}" width="230"/>
        <mx:TextInput x="89" y="310" id="email" text="{employee.email}" width="230"/>
        <mx:TextInput x="89" y="338" id="jobTitle" text="{employee.jobTitle}" width="230"/>
        <mx:Label x="19" y="15" text="Status Log"/>
        <mx:Button x="257" y="378" label="Update" width="62" click="updateEmployee(employee)" enabled="{updateEnabled}"/>
    </mx:ApolloApplication>

    So, here is what actually is taking place in this example.

    First, (after manually starting the Java ArtemisBridge) the Apollo application makes its connection to the listening port on the Java class.

    Making the connection

    Then the user loads an Employee object by id using the Hibernate load method. The Java Employee object is retrieved from the hsqldb and passed into the Apollo application.

    Employee is loaded

    The user then may edit the Employee data and send it back to Java where it is updated using the Hibernate update method.

    Employee Updated

    The ArtemisBridge will obviously need to started automatically by the Apollo application and this will be possible in future versions of the Apollo runtime.


    Cairngorm 2 AS3VOGenerator

    July 7th, 2006

    The Cairngorm AS3VOGenerator has been updated to use the new Cairngorm class paths.
    (i.e. com.adobe.cairngorm…..)

    Here is the original updated post:

    http://everythingflex.wordpress.com/2006/02/14/installing-as3vogenerator/


    AS3VOGenerator Update

    April 27th, 2006

    I have updated the Cairngorm and non Cairngorm AS3VOGenerators to implement IUID as well as the neccessary getters and setters for a new private var _uid.  This var is neccessary for components extending from listClasses to function properly when the data is bound to dataGrids, etc.

    In addition to the import statement and implementation of IUID, ere is what was added:
    private var _uid:String;
    public function get uid():String{
    return this._uid
    }
    public function set uid(uid:String):void{
    this._uid = uid;
    }

    Here is the AS3VOGererator and install directions for Hibernate Synchrinizer:

    http://everythingflex.wordpress.com/2006/02/14/installing-as3vogenerator/


    Installing AS3VOGenerator

    February 14th, 2006

    This template should be used with Eclipse 3.1 or higher and Hibernate Synchronizer 3.1.1.

    Open eclipse and go window -> preferences -> Hibernate Synchronizer -> Templates
    Hit New and enter template name AS3VOGeneratorCairngorm or AS3VOGenerator depending on which you choose below.  You can install both as long as they are named differently.
    Click OK and paste the following into your editor:

    CAIRNGORM 2 VERSION
    /*
    * This class has been automatically generated by the EverythingFlex ActionScipt 3 VO Generator template within Hibernate Synchronizer.
    *
    * For more information on ActionScipt 3 VO Generator template, visit The ActionScipt VO Builder page
    * at http://www.everythingflex.com/blog/index.cfm?mode=cat&category_id=68E24EA3-112F-5312-55A176172CDFCC38
    * or contact Rich Tretola at rich@richtretola.com.
    *
    * This is the object class that relates to the ${class.AbsoluteValueObjectSignatureClassName} Java Class
    * @ignore
    */
    package ${class.ValueObjectPackage}{

    import com.adobe.cairngorm.vo.ValueObject;
    import mx.core.IUID;

    [RemoteClass(alias=”${class.AbsoluteValueObjectSignatureClassName}”)]

    [Bindable]
    public class ${class.ValueObjectSignatureClassName} implements ValueObject,IUID {

    // neccessary to make class bindable to components extending from listClasses (datagrids, etc)
    private var _uid:String;

    public function get uid():String{
    return this._uid
    }
    public function set uid(uid:String):void{
    this._uid = uid;
    }

    #if ($class.Id)
    #if ($class.Id.hasExternalClass())
    public var ${class.Id.Property.Name}:Number;
    #else
    #foreach ($prop in $class.Id.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date;
    #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;
    #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;
    #end
    #if ($class.Properties.size() > 0)
    #foreach ($prop in $class.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date;
    #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;
    #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;
    #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 function ${class.ValueObjectSignatureClassName}() {
    }
    }
    }

    NON CAIRNGORM VERSION

     /*
    * This class has been automatically generated by the EverythingFlex ActionScipt 3 VO Generator template within Hibernate Synchronizer.
    *
    * For more information on ActionScipt 3 VO Generator template, visit The ActionScipt VO Builder page
    * at http://www.everythingflex.com/blog/index.cfm?mode=cat&category_id=68E24EA3-112F-5312-55A176172CDFCC38
    * or contact Rich Tretola at rich@richtretola.com.
    *
    * This is the object class that relates to the ${class.AbsoluteValueObjectSignatureClassName} Java Class
    * @ignore
    */
    package ${class.ValueObjectPackage}{

        import mx.core.IUID;

    [RemoteClass(alias=”${class.AbsoluteValueObjectSignatureClassName}”)]

    [Bindable]
    public class ${class.ValueObjectSignatureClassName}  implements IUID {

    // neccessary to make class bindable to components extending from listClasses (datagrids, etc)
            private var _uid:String;

    public function get uid():String{
    return this._uid
    }
    public function set uid(uid:String):void{
    this._uid = uid;
    }

    #if ($class.Id)
    #if ($class.Id.hasExternalClass())
    public var ${class.Id.Property.Name}:Number;
    #else
    #foreach ($prop in $class.Id.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date;
    #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;
    #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;
    #end
    #if ($class.Properties.size() > 0)
    #foreach ($prop in $class.Properties)
    #if (${prop.ClassName} == “Date”)
    public var ${prop.Name}:Date;
    #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;
    #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;
    #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 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 AS3 as file generation.