Flex 4


20
Jan 10

Fogbugz Day 2

In starting to write a fogbugz app, I thought this might be an ideal time to really start learning how to use Flex 4. Wow, I’m glad I did – although – there’s definitely a learning curve moving from 3 to 4. It’s a good thing though, I see where the developer is given a lot more freedom in creating and styling the components in the Flex framework and it’s nice to see states work in a way that is really useful. Here’s how it looks in my really really early early first stab at creating an item renderer:

	<s:states>
		<s:State name="normal" />
		<s:State name="hovered" />
		<s:State name="selected" />
		<s:State name="normalAndShowsCaret" />
		<s:State name="hoveredAndShowsCaret" />
		<s:State name="selectedAndShowsCaret" />
	</s:states>

	<s:Rect left="0" right="0" top="0" bottom="0">
		<s:fill>
			<s:SolidColor color="black"
						  alpha="0"
						  alpha.hovered="0.4"
						  alpha.selected="0.4"
						  alpha.selectedAndShowsCaret="0.4" />
		</s:fill>
		<s:filters>
			<s:DropShadowFilter />
		</s:filters>
	</s:Rect>

You can see where I’ve cleanly defined the states and how the properties correspond with each state. No more addProperty and removeProperty, just nice clean awesomeness. Yay!

As for the actual app, things went fairly fast today. I already was working on a small base of code but I ended up trashing it so I could start clean in Flex 4. I was able to create models for all of the FB objects and was able to knock out the login, syncing FB details (projects, areas, fixFors, etc) and getting the search to work in a fairly rudimentary way. Tomorrow I’m hoping to really clean up the case list area and start working on the view you see when looking at a specific case. Huzzah!