HTML/CSS Service

Showcase

2 comments0 views
1 Star2 Stars

Exception Handling with Flex

Category: Flex Examples, flex tutorials    |    16,971 views    |    2 Comments

A common hurdle a developer may face is dealing with exceptions in BlazeDS. When an exception is thrown in Java, how do we handle this in flex? Here is a simple and flexible approach inspired by Scott Morgan.

1. Create a Java Class that extends RuntimeException.

package com.flexpasta.exception;
public class FlexException extends RuntimeException
{
public FlexException(String message)
{
super(message);
}
}

Read more…

Share/Save/Bookmark

 

Creating a simple image gallery with the Flex TileList control

Category: Flex Examples    |    19,170 views    |    2 Comments

Flex Photo gallery in Flex using the TileList control, Image control, and the PopUpManager class.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"layout="vertical"verticalAlign="middle"

backgroundColor="white">
<mx:Style>

Read more…

Share/Save/Bookmark

 

Learn Ruby on Rails with ‘Up and Running’

Category: Learn Flex    |    335 views    |    Add a Comment

Ruby on Rails has become the poster child for cool in the server development world. Several months ago, hoping to find out what all the excitement is about, I installed Instant Rails, a nice all-in-one web server package and checked it out. As you probably know, I’m a Flash guy so I prefer developing for the front end. Even so, I quickly discovered that people had good reason to love RoR as much as they do. It’s beyond easy to work with and it’s a lot of fun!

Recently, I received a copy of Ruby on Rails: Up and Running a thin little book by Bruce A. Tate and Curt Hibbs. It had been a while since my initial discovery of RoR, and I wanted to learn more. Coming in at a mere 167 pages, I didn’t mind sitting down to read this book. Seriously, it’s a super-thin book, and I think many people might pass it up because it looks useless. However, I found that the authors crammed a ton of knowledge into every page.

A warning: This book assumes that you aren’t a programming newbie. It does not contain any introductions to the Ruby language or Object-Oriented Programming. It covers the basics of the Rails framework–enough to cause some damage–and that’s it. If you think RoR sounds pretty cool, but you don’t know Ruby, I would recommend checking out an online book, Programming Ruby: The Pragmatic Programmer’s Guide, first. It’s free and packed with information. Ruby is a bit different than other languages that you might be used to like C, Java, or Actionscript. That can be disorienting at first, but once you pick it up, you’ll be golden.

The first chapter covers the very basics. You’ll get InstantRails, the “one-click” web server I mentioned earlier, all set up. The authors examine the structure of a Rails project, and they show you how Rails provides all sorts of scripted generators to make file creation fast. You’ll look at the built-in Model-View-Controller (MVC) layout, and work a bit with the Controller and the View.

Over the next couple of chapters, you’ll learn about ActiveRecord, an exciting way to work with and abstract your database from the application. The authors show you some naming conventions that Rails naturally understands for connecting your classes to database tables. Similarly, some built-in functions provide ways for you to create relationships between your classes that match your table relationships.

The third chapter introduces scaffolding. In the early stages of the development cycle, you often need to put together simple interfaces so that you can interact with your application. Generally, these will be scrapped later for the final design. To make up for this lost development time, Rails provides scaffolding to build these temporary pages for you. It’s easy to replace these pages when you’re ready, or you can even ask Rails to give you the code it generated so that you can flesh out and build on top of the scaffold.

Before going into a chapter on unit testing, the authors show how to work a bit more with views. These are the actual displayed webpages. They cover things like templates for things like common headers and footers and functions for including stylesheets, images, and links (to generate properly structured URL for you). After that, you’ll discover an entire chapter on AJAX including built-in techniques for drag-and-drop, data filtering, and content replacement.

The holiday break is a perfect time to cross-train in other languages and work on fun projects for which you don’t normally have time. If Ruby on Rails is part of your to-do list, consider picking up Ruby on Rails: Up and Running. Merry Christmas and happy coding!

Share/Save/Bookmark