Avg. Rating 4.1

Problem

I need a simple guestbook created in Flex that I can put on my web site.

Solution

This simple Flex example gives you an example how to create a Guestbook that is very easy to implement into your web site.

Detailed explanation

This example is based on my previous post, Starting with AMFPHP, so if you haven't worked with AMFPHP before, please read it.

In this example I used AMFPHP benefits to send a simple Actionscript object with the information about user entry in the guestbook. The data is stored in an instance of a class Comment:

package org.zgflex
{
    [RemoteClass(alias="org.zgflex.Comment")]
    [Bindable]
    public class Comment
    {
        public var id:int;
        public var name:String;
        public var title:String;
        public var email:String;
        public var comment:String;
    }
}

 

The same kind of class exists on a server side and I'm using it when I want to get all previous comments and put them in DataGrid.

Note: In this example I tried to give you a simple example how to create a guestbook functionality. There are some other things that you can improve, SQL injection security, data validation in Flex form etc.

 

MyAMFPHPGuestBook.zip
[Extract this archive. Use SQL script to generate objects in AMFPHP MySQL database. Extract all from PHP directory into AMFPHP service directory. In FLEX directory you can find a finished Flex project that you can import into your Flex workspace.]
Report abuse

Related recipes