What is the best practice to develop a visual component in Flex Hero?
Posted
by
gavri
on Programmers
See other posts from Programmers
or by gavri
Published on 2011-05-04T08:22:52Z
Indexed on
2012/06/06
16:49 UTC
Read the original article
Hit count: 215
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?
© Programmers or respective owner