Thursday, July 30, 2009

Loading Modules in Flex

I have in the works an article on map interfaces. Its challenging to provide the map and metadata on, say, a point clicked on the map. Maybe its a marker for a house for sale. I click on the marker, where do I display the price, images, descriptions etc? Pop up, draggable boxes, open a new page. Lots of choices, some better than others. Flex actually increases the possible cool options here.

My article was driven by a new local search application I am writing. I'm debating whether to load modules within the application. With this in mind, I have built a demo. Right click and you can view the code. This does the following:
1) Loads modules on the fly based on user button click; next or previous(note the use of an interface)
2) Allows the main application to call methods in the loaded module.
3) The modules listen to events fired from the main application
4) The text in the main application is localised; so button labels can be switched from English to Spanish.

Take a look at the code or download it to test. In the project properties ->flex modules, you will need to have the two modules included. So they are compiled with the application.

The demo is potentially a base for building mapping applications. Or applications which include a mapping module.

No comments: