Flex2 :: include :: I found a use for it!
Hello,
I was creating some components the other day and realized that flex2 components source files when creating for public release get REAL BIG. So, with styles, effects and events, the meta data with comments start to look like classes themselves.
Here is a solution that I am sticking to, it will be interesting to see how Adobe has implemented or should I say addressed this ‘problem’. I have basically taken all the meta preceding the class signature out and included them into 3 seperate files.
- TitleBarEvents.as
- TitleBarStyles.as
- TitleBarEffects.as
You would then put these files in the package of barControls but in a sub package of metaTitleBar. I use the meta part first because when you look at the directories, they will be listed alphabetically and the meta directories will stay out of the way of all your other packages(grouped).
package com.teotigraphix.barControls
{
import com.teotigraphix.core.AbstractBox;
…
// include the [Event()] Meta
include “./metaTitleBar/TitleBarEvents.as”
// include the [Style()] Meta
include “./metaTitleBar/TitleBarStyles.as”
// include the [Effect()] Meta
include “./metaTitleBar/TitleBarEffects.as”
/**
* Provides title bar modules for the Window component or other components.
* @author Michael J. Schmalle
* @date 04-03-06
*/
public class TitleBar extends AbstractBox
{ …
Now I have things grouped and centralized so I am not going crazy with the hundreds of lines that these elements take up!
Flex2 adds quite a bit of things that you do not find in the Java coding environment that are required i.e. meta data but, I belive this is a great way for flex2 to stay on top and have the ability to extend the compiler/ui interface in the future.
Peace, Mike
April 11th, 2006 at 4:49 pm
LIKE YOUR APPROACH AS USUAL….iTS SOMETHING DIFFERENT