Question

What is the best practice to develop a visual component in Flex Hero?

I do it like this: I consider a component has 2 "parts", the declarative part (the visual sub-components) which I define in the skin (just mxml) and the code part (event handlers...) which I define in an action script class. I load the skin in the ctor of the action script class. I also define skin parts, states, and I bind event handlers in the partAdded function.

I am having an argument about this; that I should define the component purely in an .mxml, with listeners in the script tag, and maybe attach a skin (but the skin should be loose - maybe for reuse :-?)

I come from .NET and maybe I am biased with the code behind pattern, and I am wondering from your experience and Adobe's intent, what is the best practice to usually implement a visual component?

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top