With the Macromedia Flex package comes a collection of sample applications. One of the best ways to see how things work in Flex is to install the Samples and browse through the code.
To install the samples, start by downloading and installing Macromedia Flex as per the previous instructions:
Installing Flex
Move the samples.war file to the /usr/java/tomcat/webapps directory
mv /opt/Flex/samples.war /usr/java/tomcat/webapps/
Restart Tomcat and it will automatically deploy the samples.war file to the /usr/java/tomcat/webapps/samples directory
/etc/init.d/catalina restart
Browse to http://localhost:8080/samples/