Var trouble

Hey all!

I have a little problem. Please take a look at the following (simplyfied) code:


opListener.change = function() {
  //opBox is a combobox (component)
  var getOp:String = opBox.getSelectedItem().label;
  showText(); 
}

function showText(val) {
  descText.htmlText = getOp; // display text
}

Now what bugs me, is that my variable “getOp” is filled, but I can’t call it outside the opListener.change function.
I’ve been searching the internet, but couldn’t find a solution. I might just be too tired and am probably missing something bigtime here.

If you could help me, that’d be very much appreciated!
Thanks in advance,

[COLOR=DarkGreen]Ferdi[/COLOR] :slight_smile: