# Var trouble

**URL:** <https://forum.kirupa.com/t/var-trouble/191574>\
**Category:** Uncategorized\
**Created:** [June 21, 2006, 1:59pm UTC](https://forum.kirupa.com/t/var-trouble/191574 "2006-06-21T13:59:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferdi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ferdi/32/689_2.png) [@Ferdi](https://forum.kirupa.com/u/Ferdi)\
**Post date:** [June 21, 2006, 1:59pm UTC](https://forum.kirupa.com/t/var-trouble/191574/1 "2006-06-21T13:59:11Z")

</div>

Hey all!

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

```php

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] 🙂
