I would recommend dumping link reports from the modules and examining them to see what they share. If there's a significant amount of stuff or there are singleton managers or styles, they should go in the sharedcode module pretty much like the version you've showed herer.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of danielvlopes Sent: Tuesday, September 18, 2007 9:49 AM To: [email protected] Subject: [flexcoders] Re: Reduce size of my module! Really boring.... Ola Alex, I obtained to compile using ant with using link-report and load-extern together with rsl. My buidl.xml is this: <?xml version="1.0" encoding="UTF-8"?> <project name="PainelAdmApp" default="compile"> <property name="flex.mxmlc" location="C:\Arquivos de programas\Adobe\Flex Builder 3\sdks\moxie\bin\mxmlc.exe" /> <property name="flashplayer" location="C:\Arquivos de programas\Adobe\Flex Builder 3\Player\win\FlashPlayer.exe" /> <property name="deploy.dir" value="bin" /> <target name="compile"> <exec executable="${flex.mxmlc}" dir="." failonerror="false" failifexecutionfails="no"> <arg line="PainelAdmApp.mxml -runtime-shared-library-path=C:\moxie\frameworks\libs\framework.swc,fram ework_3.0.172357.swf -services services-config.xml -link-report=PainelAdmAppReport.xml -output ${deploy.dir}/PainelAdmApp.swf" /> </exec> <exec executable="${flex.mxmlc}" dir="." failonerror="false" failifexecutionfails="no"> <arg line="Admin.mxml -runtime-shared-library-path=C:\moxie\frameworks\libs\framework.swc,fram ework_3.0.172357.swf -load-externs=PainelAdmAppReport.xml -output ${deploy.dir}/Admin.swf" /> </exec> <exec executable="${flex.mxmlc}" dir="." failonerror="false" failifexecutionfails="no"> <arg line="Equipamentos.mxml -runtime-shared-library-path=C:\moxie\frameworks\libs\framework.swc,fram ework_3.0.172357.swf -load-externs=PainelAdmAppReport.xml -output ${deploy.dir}/Equipamentos.swf" /> </exec> <exec executable="${flex.mxmlc}" dir="." failonerror="false" failifexecutionfails="no"> <arg line="Servicos.mxml -runtime-shared-library-path=C:\moxie\frameworks\libs\framework.swc,fram ework_3.0.172357.swf -load-externs=PainelAdmAppReport.xml -output ${deploy.dir}/Servicos.swf" /> </exec> </target> </project> But i'm still want to know need do this, like you made in you example for Flex360 presentation: I should create a class with all this components? like this: package { import mx.modules.ModuleBase; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.controls.DataGrid; import mx.containers.Panel; import mx.controls.Button; public class SharedCode extends ModuleBase { private var dragManager:DragManager; private var dataGrid:DataGrid; private var panel:Panel; private var button:Button; private var resultEvent:ResultEvent; private var faultEvent:FaultEvent; } } --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "danielvlopes" <[EMAIL PROTECTED]> wrote: > > Hello Alex, i read your presentation and try find ant in your blog and > i found only this > (http://blogs.adobe.com/flexdoc/2007/01/two_new_tools_flex_ant_tasks_a.h tml <http://blogs.adobe.com/flexdoc/2007/01/two_new_tools_flex_ant_tasks_a.h tml> ). > > In examples used in your application you share code between modules > using a external AS class called SharedCode extends ModuleBase ... in > my case i don't had any dragManager or popupManager, just some > Datagrids, buttons, panels, rpc for amfphp and other commons > components. I should create a class with all this components? like this: > > package > { > import mx.modules.ModuleBase; > import mx.rpc.events.ResultEvent; > import mx.rpc.events.FaultEvent; > import mx.controls.DataGrid; > import mx.containers.Panel; > import mx.controls.Button; > > public class SharedCode extends ModuleBase > { > private var dragManager:DragManager; > private var dataGrid:DataGrid; > private var panel:Panel; > private var button:Button; > private var resultEvent:ResultEvent; > private var faultEvent:FaultEvent; > } > > } > > In your example you load your SharedCode.swf in MyApp.mxml, even i use > load externs in my module pointing to shrclasses.rpt should i must > load SharedCode.swf in my main app? > > In your examples for Flex360 you don't show how use RSL together > --link-report and --load-exeterns modules. > In my project i'm using like teached in video on adobelabs, not using > any line comand compiler. > > I will use ant to compile because i'm using windows and cygwin don't > work for windows. > > I try use ant following this tutorial: > http://howtoforge.com/amfphp_adobe_flex2_sdk <http://howtoforge.com/amfphp_adobe_flex2_sdk> > > Thanks, and sorry for disturb. > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote: > > > > The host generates a link-report that the modules load-extern so that no > > classes in the host are in the modules. > > > > > > > > If you use the framework as an RSL, then compiling with that option on > > should flush all of those classes as well. If you generate link-reports > > from your modules, you can see if everything that should be removed got > > removed. > > > > > > > > The shared code example on my blog also addresses how to deal with a set > > of modules that share code among themselves. > > > > > > > > ________________________________ > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > > Behalf Of danielvlopes > > Sent: Monday, September 17, 2007 1:28 PM > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: Reduce size of my module! Really boring.... > > > > > > > > Hum... i will take a look in you blog. In my case application is only > > "module caller" (don't had any component beyond viewstack and > > moduleloader), and every components and codes is inside of my modules > > (all modules is very similar). > > Should use link-report in one module and load-externs in other modules > > or i should still using link-report in application and load-externs in > > modules? > > > > In your first answer you said "Take a peek at the .xml to see if it > > has everything it should. ", it is for looking at if all the > > components that use are in xml? > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > , "Alex Harui" <aharui@> wrote: > > > > > > I would recommend making your module project think it is using the > > > shared framework RSL. > > > > > > > > > > > > ANT is its own thing and does not need FB or eclipse, although I think > > > there is eclipse integration. You can also just use shell scripts in > > > cygwin. That's what I did on my blog. > > > > > > > > > > > > The goal is to use load-extern enough times with enough stuff in it > > that > > > everything in the main app and the framework RSL is not in the module. > > > > > > > > > > > > ________________________________ > > > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > ] On > > > Behalf Of danielvlopes > > > Sent: Monday, September 17, 2007 5:23 AM > > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] Re: Reduce size of my module! Really boring.... > > > > > > > > > > > > I try use ant but don't find material necessary to know how use or how > > > install... I can use ant in FB or i need to use eclipse with pluggin > > > for Flex? Do know one site with tutorial about ant? > > > > > > When i use RSL for separete framework i still can use load extern > > > whitout RSL in project of my module or i need to make module project > > > with RSL to? > > > > > > Thanks Alex. > > > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > > , "Alex Harui" <aharui@> wrote: > > > > > > > > I haven't use FB to do this. I use ANT or batch scripts. Take a peek > > > > at the .xml to see if it has everything it should. > > > > > > > > > > > > > > > > ________________________________ > > > > > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > > ] On > > > > Behalf Of danielvlopes > > > > Sent: Sunday, September 16, 2007 12:28 PM > > > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > > > Subject: [flexcoders] Reduce size of my module! Really boring.... > > > > > > > > > > > > > > > > Hello, > > > > > > > > Now in Brasil is sunday, and i waste all my day trying reduce swf > > size > > > > of my modules... > > > > > > > > I had project with 11 modules... each module had approximately 90kb, > > > > because in my project i'm using framework caching teached in this > > > > video (http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > > > > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > <http://labs.adobe.com/technologies/flex/videos/flex3rsls/ <http://labs.adobe.com/technologies/flex/videos/flex3rsls/> > > > ), all > > > > modules are inside of my main project. > > > > > > > > I try to put each module in separete project, in project properties > > in > > > > my main project i put this on compile line, > > > > link-report=D:/Daniel/Trabalho/bms/painel_adm/report.xml to generate > > > > report.xml . > > > > > > > > In each of my modules i put > > > > load-externs=D:/Daniel/Trabalho/bms/painel_adm/report.xml to try > > > > reduce swf size of my modules. > > > > > > > > But the problem is now each module had approximately 250kb, bigger > > > > than with modules inside a single project. > > > > > > > > What can i do to fix this problems? > > > > > > > > > >

