views:

350

answers:

1

How to take an existing custom component in Flex and convert it into a module?

EDIT: What should be done in the mxml where this custom component is used? Should it be replaced with a to load the module? If yes, how to deal with code that uses instances of the components?

+1  A: 

Change the root mxml tag to <mx:Module... then in the properties of the project click on the "Flex Modules" button and add it in there.

Edit: This is assuming your modules are in the same project. I prefer to create new projects per module as it makes development easier with multiple developers. So what I do is create a new project, change the root to <mx:Module..., in the properties of the module project I disable it from creating the html wrapper, then in my main project I just load up the module swf's based on what menu item was clicked

Chris Klepeis
The problem with having a separate project, is that you'll have to worry about relative paths and making sure everything is compiling correctly.
Christopher W. Allen-Poole