# I die: function() problem

**URL:** <https://forum.kirupa.com/t/i-die-function-problem/192720>\
**Category:** Uncategorized\
**Created:** [June 30, 2006, 2:10pm UTC](https://forum.kirupa.com/t/i-die-function-problem/192720 "2006-06-30T14:10:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saevik](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@saevik](https://forum.kirupa.com/u/saevik)\
**Post date:** [June 30, 2006, 2:10pm UTC](https://forum.kirupa.com/t/i-die-function-problem/192720/1 "2006-06-30T14:10:03Z")

</div>

Hi,

I have a problem with function(), and it’s bugged me all my day at work (over 7 hours so far :ogre:). I’ve been tearing my hear off trying to solve this, while throwing litres of espresso in me, finally I ended up running to the Kirupa forums for some expert help… 😃

Here’s the deal: I have a function with some variables whereas one of them calls yet another variable. And that’s where my code fails. Below is the code (simplified), along with some brief explanation to help you through…  
menu is the instance name of a ComboBox, and it sends the value “left”. This is proven to make it to the the function by using [COLOR=black]trace. The problem also occurs when replacing the ComboBox with for example an input text box. It seems to fail each time I don’t directly give the variable a value…[/COLOR]  
Now: :ub:

The button:

```auto
on (release) {
 myFunction(myMovieClip, 20, menu.value);
}

```

The actions layer:

```auto
myFunction = function(mc, alpha, align) {
 mc._alpha = alpha;
 align(mc);
 trace(align); [COLOR=red]//this outputs left <-- ![/COLOR]
}
 
left = function(mc) {
 mc._x = mc._width/2*-1;
 mc._y = 0;
}

```

This does not work, even though it traces “left”, :h: however, this works;

```auto
on (release) {
 myFunction(myMovieClip, 20, [COLOR=red]left[/COLOR]);
}

```

this works, too:

```auto
on (release) {
 [COLOR=#ff0000]variable[/COLOR] = left;
 myFunction(myMovieClip, 20, [COLOR=red]variable[/COLOR]);
}

```

but this[COLOR=black] doesn’t[/COLOR] work:

```auto
on (release) {
 menu.value = [COLOR=red]variable[/COLOR];
 myFunction(myMovieClip, 20, [COLOR=red]variable[/COLOR];);
}

```

?? :look: ??

Please, before I die of exhaustion =), we’re soon out of espresso at work, too !

If anyone could help in any way, I’d appreciate it aLOT 🙂  
Thanks!

Peter
