Jump to content


ComboBox Handling


  • You cannot reply to this topic
4 replies to this topic

#1 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 13 July 2007 - 10:37 AM

ok, i got 2 comboBox's in one form and im trying to handle them in one function...

they are called "requirement" and "budget"...

heres the code which is on the same frame:

requirementData = 0;
budgetData = 0;
function change(evt){
	if(evt == "requirement"){
	requirementData = evt.target.selectedItem.data;
	}
	if(evt == "budget"){
	budgetData = evt.target.selectedItem.data;
	}
	trace(requirementData);
	trace(budgetData);
	
}
requirement.addEventListener("change", this);
budget.addEventListener("change", this);

the problem is simple, the variables do not change like they should.

this thing works perfectly with just one comboBox, its just when i introduced the if statements it didnt like it...

#2 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 13 July 2007 - 11:46 AM

Trace what evt is equal to. Chances are it doesn't equal either of the things you are comparing it to.

#3 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 13 July 2007 - 11:48 AM

thats strange, its equal to [object, Object]...

what does that mean?

#4 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 13 July 2007 - 12:25 PM

It's an event object.

Try tracing evt.target

#5 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 14 July 2007 - 01:46 PM

cheers dude, great help!! :rolleyes:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users