AS noob needs help!

Hiya, I’ve got a simple yet frustrating problem in MX 2004. I’ve got a combo box in my movie (called news_selector), whenever the selection of the combo box changes, I want to do something. Here’s my code for the combobox so far…

 
on(change)
{
trace("News feed changed to: " +news_selector.selectedIndex);
if (news_selector.selectedIndex == 1) 
{ 
	 newsFeed.URL = "[http://www.movabletype.org/news/index.rdf](http://www.movabletype.org/news/index.rdf)";
	 newsFeed.direction = "receive";
	 newsFeed.ignoreWhite = true;
	 newsFeed.trigger(); 
} 
else if(news_selector.selectedIndex == 2) 
{ 
	 newsFeed.URL ="[http://www.trainingfromthesource.com/blog/index.rdf](http://www.trainingfromthesource.com/blog/index.rdf)";
	 newsFeed.direction = "receive";
	 newsFeed.ignoreWhite = true;
	 newsFeed.trigger(); 
} 
} 

The problem is that the news_selector.selectedIndex bit is showing as undefined in the debug window, and thusly the if/else statements are ignored completely. What am I doing wrong exactly? Help!

Ok I managed to fix it. Just needed to use “this” instead of the combo boxes instanct name :slight_smile: