Travel agency Flash Lite 2.0 application - inside view

This page reveals the implementation secrets of the Travel agency application in Flash Lite 2.0.

This application is inspired by the tutorial from Macromedia. Tutorial was completed with travel agency in mind, custom graphics were created and some flexibility added by moving tour info to external file. Here is the link to tutorial.

Textual information about tours is loaded from the text files using LoadVars object.

Here is description of how it works:
First we create LoadVars object with the name myData.
Initiate loading by calling load method of created object.
Define callback function which is called then loading is complete. That function will copy data about tour offers from the myData object to different arrays for easier later access.

myData = new LoadVars();
myData.load('http://www.diamondesign.net/flash/content');
myData.onLoad = function() {
	itemtitle = new Array();
	itemcomment = new Array();
	itemimage = new Array();
	for (j=0; j<4; j++) {
		itemtitle[j] = this['title'+j];
		itemcomment[j] = this['comments'+j];
		itemimage[j] = this['image'+j];
	}
};

Here is the content of the file that is loaded from the server. All content is formatted in one line.

Title0=Miami beach&Comments0=Departs From Miami, Florida visiting Half Moon Cay, Bahamas (Private Island) 450 euros&Image0=1.jpg&Title1=Palm trip&Comments1=The nice trip to palm country. 380 euros&Image1=2.jpg&Title2=City trip&Comments2=You visit more than 5 capital cities. 280 euros&Image2=3.jpg&Title3=Canarian islands&Comments3=The white sand beach for you. 280 euros&Image3=4.jpg&cant=4