# Storing expressions in variabels?

**URL:** <https://forum.kirupa.com/t/storing-expressions-in-variabels/177001>\
**Category:** flash\
**Created:** [January 29, 2006, 1:36am UTC](https://forum.kirupa.com/t/storing-expressions-in-variabels/177001 "2006-01-29T01:36:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YellowSnow](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@YellowSnow](https://forum.kirupa.com/u/YellowSnow)\
**Post date:** [January 29, 2006, 1:36am UTC](https://forum.kirupa.com/t/storing-expressions-in-variabels/177001/1 "2006-01-29T01:36:35Z")

</div>

Hello everyone!

Is it possible to save more complex expressions in variables and use it later/in an other object?

For example:  
If i want to store the expression (not the value) of [COLOR=black]in a variable, for exampe type something in an input textfield and then use it during runtime.[/COLOR]

Say i type “[COLOR=red]mc.\_x +100[/COLOR]” (without "-marks) into the textfield myText on stage (while the movie is running)

[COLOR=red]function stageTrace(value) {  
trace(value);  
}  
bt.onRelease = stageTrace(myText.text);  
[/COLOR]

Since myText.text is a string the output will be exaclty what i typed in. What i wan however is flash to treat it like an expression, and send a number to the output window. How do i acomplish this? (i’ve tried with eval and [], none of them gives the effect i want :h: …)

What am i doing wrong?

Thankyou for your time/  
Martin
