I have a function that puts a border on various components and containers.
I wonder how I can datatype the component parameter.
I.e. how to deal with function parameters when the datatype is unknown ?
Use whatever base type all the components have in common... probably UIComponent. For example, since both Button and HBox are just special types of UIComponent (because they extend UIComponent), you can pass either a Button or an HBox to a method that is expecting a UIComponent. If you want to get fancier, use the IUIComponent interface which they also have in common.
Adobe Flex SDK Team