Him Guarev, 
I tried what you suggested but the errors only appears when using
using the flex localization.
My Module locales are located in
-projectHome
-->locale
---->en_US
-->src

The flex project that uses the module puts the "module home" project
in its source path, and since the module uses locales (under [project
home dir]locale\en_US) I want the module to include these locales at
compile time.
However, when compiling the main app (the shell) it complains about
the module's locale files (ModuleTexts.properties for example)

How does the main app knows about the locales ?
It reads the [ResourceBundle("ModuleTexts")] from the module file and
looks for them at it's own project, not looking inside the modules
project to see if the locales are there.
That's seems reasonable, since it doesn't uses the project itself, but
the source path, in which there is no information of the locale path.

How I can get rid off these errors ? include the locale properties
files inside the shell app. I did this only for testing, since it's
tears apart the module encapsulation and add extra responsibility for
 someone using this module...

:|

I uploaded the 2 flex projects so anyone can see the error:

http://www.filefactory.com/file/109714

Thanks again.

Almog Kurtser.





--- In flexcoders@yahoogroups.com, "Gaurav Jain" <[EMAIL PROTECTED]> wrote:
>
> So I assume you are just looking to move module(s) into a separate
> flex builder project? If my assumption is correct read on. 
> 
> It is possible to load the modules from a different project. A module
> is after all a SWF so you theoretically be able to load it from a url
> (as long as you don't run into domain issues).
> 
> Here is what I would do.
> 1. Create a Flex Project in Flex Builder.
> 2. Add what ever modules, you need to add.
> 3. Delete the main app file (from this project).
> 4. Go to project properties - > Flex modules -> double click on all
> modules (one by one) and remove the option for Optimize for.
> 
> The disadvantage for moving modules to a separate project is that you
> loose capability for automatic "optimize for". This is used to reduce
> the size of the module by not duplicating classes which are already in
> the main application.
> 
> However there is a workaround:
> 
> In the main project (from which you want to move *out* all modules):
> 1. Go to project properties -> Flex compiler
> 2. In the additional compiler arguments add -link-report=lnkreport.xml
> (you can also give the absolute path for where you want the link
> report to be generated).
> 
> Now in the project which will contain modules.
> 1. Go to project properties -> Flex compiler
> 2. In the additional compiler arguments add
> -load-externs=lnkreport.xml (make sure path is same as what you gave
> in the main project).
> 
> This would make sure that modules in the separate project would be
> optimized for your main app.
> 
> Now since you moved them to a different project, you need to copy the
> compiled modules to the location specified by the url used to load the
> modules. or simply change the Output folder for the modules project by
> going to project properties -> flex build path
> 
> HTH, 
> Gaurav
> 
> --- In flexcoders@yahoogroups.com, "mydarkspoon" <mydarkspoon@> wrote:
> >
> > Thanks for your response, but RSL won't fit in this situation.
> > RSL are loaded at the application startup, however, I'm using module
> > because I want to load the component by demand.
> > 
> > I've used modules before, but never been using modules that sits in a
> > different project.
> > It's important that the module will be separated from the main
> > app/apps so that one developer can add features to the module, while
> > another one can work on the loader app and have an up-to-date module
> > compiled using source control.
> > 
> > Cheers,
> > 
> > Almog Kurtser.
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "Gaurav Jain" <gauravj@> wrote:
> > >
> > > The idea behind modules is to make your main app smaller (by
breaking
> > > into modules) so that you can speed up initial load time. And
> > > load/unload modules when ever required.
> > > 
> > > By default when you compile a module, flex builder optimizes it for
> > > the main application - which means it does not add classes to the
> > > module which are already in the main app. 
> > > 
> > > You can share the same module between different applications as long
> > > as you don't optimize your module for any particular app.
> > > 
> > > Module is runtime thing. Adding module into a library will not work.
> > > 
> > > If you are looking to share common code across application and
are not
> > > interested in modules, you can use libraries. 
> > > 
> > > Also if you want to share code across different application but you
> > > want to do so at runtime, you can benefit from using runtime shared
> > > libraries. For more information about rsls see here
> > >
> http://livedocs.adobe.com/labs/flex3/html/help.html?content=rsl_02.html
> > > 
> > > Thanks,
> > > Gaurav
> > > 
> > > --- In flexcoders@yahoogroups.com, "mydarkspoon" <mydarkspoon@>
wrote:
> > > >
> > > > Hello,
> > > > I've developed a small flex module which I used inside flex
project.
> > > > Now I want to allow different applications to use that module,
so I
> > > > thought the best way to allow them using it is to distibute the
> module
> > > > in  a flex library project.
> > > > 
> > > > However, when I put the library project in the source path of
> new flex
> > > > project and mark it as a module, I get compile errors telling me
> that
> > > > the *new project* (not the lib project) can't find the module
> > > > resources (locales).
> > > > 
> > > > I think the lib project should be the one responsible of having
> these
> > > > locale resources, not the flex project that uses it.
> > > > 
> > > > in the flex lib project I put this in the additional compiler
> > arguments:
> > > > -locale=en_US -allow-source-path-overlap=true -incremental=true
> > > > and added the locales to the source path:
> > > > locale/{locale}
> > > > (just like I've done in a regular flex project)
> > > > 
> > > > 
> > > > Any ideas of what I'm wrong ?
> > > > (When running the module in a regular flex project, I get it to
> > > > compile fine with the locales)
> > > > 
> > > > Thanks in advance,
> > > > 
> > > > Almog Kurtser.
> > > >
> > >
> >
>


Reply via email to