views:

272

answers:

2

I'm a seasoned PHP developer and have spent quite a few years building AS2 and timeline Flash projects as well. And, I'm extremely anxious to start working in Flex as well. - I have the perfect project for it too. However, while reviewing the tutorials and example Flex projects, they seem to focus mainly on form elements and data grids, rather than delivering content in a more visual way. Which is what I will need for this upcoming project. As a result, I have a gap in my comfort level that I'm hoping that a seasoned Flex developer can help me hurtle.

The project that I have is a collaboration index tool to display customers products and services using an user interface with four separate panels. 1. the top-left panel will contain a list of categories in a vertical scroll. 2. The bottom left panel will contain a wheel effect of sub-categories, based on the category chosen. 3. The top right panel will contain the detail information - The selected Category Title and Description. And below that, the selected sub-category title and description. 4. The bottom right panel will contain a list of the service and product items that belong to the sub-category. Below each item in the list will be a link-group accordion with url links for more information in each. There will be an XML file containing the complete data tree driving this collaboration index. Additionally, depending on the category chosen, color variances will occur in the background of the some of layout sections.

So, It appears that I will need to create a few custom components, maybe adopt a few existing components, and re-skin everything so that it carries a synonymous look and feel to the client's branding.

Although I have a bunch of questions, tackling the first section seems logical, and the first question that comes to mind in this section is: in the top left panel, should the list of categories be standard Flex buttons that are re-skinned? or should they be object instances somehow brought in to Flex. Then in the second section, I was had seen a component that displayed images in a way that was perfect for this section. But, the items show here would be just visual, rounded corner blocks with subcategory names in them. So, I'm not sure if that component will work or not.

Thanks in advance for your assistance!

+1  A: 
  1. AS3 is very different from AS2. I'm sure you've noticed by now, but it's worth mentioning in case you hadn't.

  2. Flex Components are basically just a package of Flash objects. So you can, sort of, write every Flex component on your own using just Sprites and/or TextFields. This includes skins. A skin is pretty much just a Shape attached to an object with custom drawing.

  3. A button is just a combination of image+textField+skin, with all the events and skin transitions managed for you.

The reason I mention this is that there is no right way to do what you want. If you're using the List control, you should probably write a component that implements IListItemRenderer. Button does, so you can simply override the Button, no problems. You can have buttons with a label + icon. Or just icon. Or just a label. You can also define where the label is positioned relative to the icon (labelPosition="above|below|left|right"). There is a lot of built-in flexibility.

Glenn
A: 

I have been developing Flex 4 quite heavily the past 6 months and must say it would make your job very easy.

Here's what I would do:

1) Check out FlexSpaces for the best Flex 3 project architecture. It's a fully featured CMS in Flex with categories, tags, searching, filesystem, collaboration, etc.

2) Download the Flex 4 SDK and install that. There's no need to use Flex 3 anymore, if you're just getting started, DEFINITELY go with Flex 4. If you need custom components, Spark (the new component architecture) has a very simple way of doing them (here's a cool blog post building a Rating Component in Spark that shows you how do it). Flex 4 is backward compatible with Flex 3 components, so you can use projects/components you find on the internet if you want to, no problem.

3) For the top-left category list, if the categories aren't nested, I would use the spark.components.List, (here's one using more complex item renderers). Then just extend the spark.components.supportClasses.ItemRenderer, which acts just like a Skin. If categories are nested, just use the mx.controls.Tree. Check out that FlexSpaces project for that (they show how to use XML/ArrayCollections in the tree, your "object instances brought into flex somehow" question).

4) For the wheel effect, the only thing I don't like about Spark so far is that it's difficult to animate layouts. But people are starting to make 3D layouts, check out Here's 5 3D Layouts for Flex 4 by Ryan Campbell. There's also OpenFlux if you want very easily animated layouts. Flex effects in general are quite clunky, so I end up just using Tweener or TweenMax for animations.

5) As for reskinning, trying to reskin using the Flex 3 architecture would be a monumental task, if you wanted to make it look clean and nice, and it would be insane trying to reuse that code in the next project. For Spark, it's a snap, and it's 100% mxml. Just copy the whole sparkSkins folder from the SDK and start changing things, and you're good to go.

But yeah, that FlexSpaces project is a very solid example for what you're talking about. Totally open source.

Cheers

viatropos
Flex 4 is still in beta. May not be an issue here, but it's worth mentioning.
Glenn
Flex 4 is leaps and bounds better at the visual customization that I need. So, this is exactly the kind of info that I was hoping to get. Thanks!
tdurham