Flex tricks : Flash icon as maximize panel button
(translated from my original spanish article by me, sorry for mispellings, sometimesmy english sucks)
Many developpers that comes from a Flash background probably miss the freedom that we use to have in Flash to position graphics elements, fire events from everywhere, modify elements or call methods whitout worry about Cast or undefined objetcs, etc. That's the cost of using a more serious language like AS3 and also a solid framework like Flex. Anyway sometimes we want all: be rigorous but have more freedom. About graphic elements, as far as you come familiar with styles (specially if you have some CSS background) things goes better.
Anyway, sometimes problem arise of course, and this is the story of a little hack I was forced to use. But let's go to the story
Problem
Client: Can't we use an icon to maximize the panel?
Me: Of course, we can put in the left top corner, behind the title
<!-- Developper subtext: this is a Panel component, I can use a titleIcon, but there's no style to align the icon to rigth, just the title-->
Client: Nop, I prefer it on the rigth top corner, like Guindows
Developper: Ok... (arrggghhhhh)
Of course, one solid principle of coding is that always exists some workaround. If the Panel documentation doesn't mention a style to align the titleIcon to the rigth, let's search ... F1 ... searching .... Google ...searching ... arghhh. Should I ask on flash-db forums ?
Ok, can't find and this is the situation

I can't find a property to align the Icon to the other side ... probably exists, but can't find it (and I writed the tutorial because this, so if you find, DON'T let me know) Anyway I consider some workaround: using an swf file with some code ... in fact doing a little hack to Flex styles
To follow the example, please download the source files. This files are a Flex project that you can import from menu File->Import->Flex Project, and selecting the FlexHack folder
Those with more experience can skip the step to step explanation and go directly to resume
The working example in the last page

5 most recent
Flash button as Flex icon
Tree menu
Flash Spell Checker
Flash Remoting Library
MX 2004 Chart/Poll
Articles