Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populating combobox from external file

Status
Not open for further replies.

stakadush

Programmer
Oct 1, 2001
195
IL
i am trying to populate a combobox (named countriesBox) in the flash file from an external text file. it works great when i run the swf directly but when i use loadMovieNum() function to load it inside a different flash movie it won't populate the combobox.
here's my actionscript code:

Code:
this._lockroot = true;

//load the text file
var countryList = new LoadVars();
countryList.load("countries.list");
countriesBox.addItem("-- your country --", '');
countryList.onLoad = function() {
	var comboCountries = countryList.countries.split(",");
	var why = false;
	for (i=0; i < comboCountries.length;i++) {
        countriesBox.addItem(comboCountries[i],comboCountries[i]);
	}
}

i just can't understand why it works great as a standalone movie and won't work when loaded inside another movie.
by the way, i'm loading it as follows (into layer 3):
Code:
on (release) {
	loadMovieNum(&quot;mailist.swf&quot;, 3);
}

i'm using flash mx 2004 professional...

(-:
 
If you create all the components using attachMovie method the you can populate combobox dynamically.
 
You're not loading on layer 3 but on level 3. Thus your path is wrong.

Regards,

cubalibre2.gif
 
that seems to happen at times..bit of a bug...attaching dynamically will work, so will using a listbox instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top