Search Flex Samples

Explicit support for Module base application

Imagine if your application has 1000 or more pages with high end graphics and animation. You must think about performance. The simple answer is module base application.

Module, It was really great feature of “flex 2.0.1 hot suffix 2.0 SDK” but in flex builder 2.0 was not having explicit support for Module based application. Therefore we have to make separate modules, compiling report.xml, then recompile all the modules ….. ohhhh that was really frustrating process.

But now flex 3.0 has explicit support of module based application. That means flex builder itself will handle all this process. Here I have tried to explain how flex builder 3.0 supports modules.

Create Module more easily

To create new module just right click on your project and select new module. It will ask you name of the module. There is one other combo box with label of optimize size for application. Now this is some thing really good in flex builder 3.0. This feature will generate report.xml file and optimize your application for selected application.

This action will add tryThisOut.mxml module to your project.

Tip

If you are creating 100% liquid module which should fit in to your module loader container, then you have to use percentageWidth and percentageHeight properties of module class. Check below image

Now when you press ctrl +b or press “Build all buttons”, it will generate tryThisOut.swf file in your output folder. Then after you can load this module wherever you require.

Manage modules

Flex 3.0 adds modules to project when you create new one. But if you want to copy and paste module from other project to your current project you have to add manually. To do that just right click on current project on navigator window then after click on property button at the bottom of the pop up menu. You will find module link on open dialog box. There is one button “add” on right side. You can simply add module. You can also edit existing module from the same window.

Debug modules

You have to just allow modules for debugging by clicking on enable debugging modules. That will allow you to debug your modules

Hope this will help you.

0 comments:

Related Flex Samples

Learn Flex: Flex Samples | Flex Video Tutorials Flex Examples