# General question

**URL:** <https://forum.kirupa.com/t/general-question/6775>\
**Category:** flash\
**Created:** [October 16, 2002, 9:12am UTC](https://forum.kirupa.com/t/general-question/6775 "2002-10-16T09:12:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanley](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Stanley](https://forum.kirupa.com/u/Stanley)\
**Post date:** [October 16, 2002, 9:12am UTC](https://forum.kirupa.com/t/general-question/6775/1 "2002-10-16T09:12:11Z")

</div>

Okay I’m stupid…

but I still do not fully understand when to use “eval(varname)” and when not to. What does EVAL do?

Stanley

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 9:43am UTC](https://forum.kirupa.com/t/general-question/6775/2 "2002-10-16T09:43:49Z")

</div>

The eval() function is used to access variables, properties, objects, or movie clips. If the expression is a variable or a property, that value is returned. If the expression is an object or movie clip, it’ll tell you and give you a reference to that.

Think of it as evaluating the contents of a named object.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 1:30pm UTC](https://forum.kirupa.com/t/general-question/6775/3 "2002-10-16T13:30:20Z")

</div>

… and it is very bad practice…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 1:34pm UTC](https://forum.kirupa.com/t/general-question/6775/4 "2002-10-16T13:34:18Z")

</div>

why do you say it’s bad?

i personally never use it, preferring array notation, but never heard that it’s “bad”

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 2:07pm UTC](https://forum.kirupa.com/t/general-question/6775/5 "2002-10-16T14:07:01Z")

</div>

I don’t know, it just feels ugly. It makes everything unclear. 😕

And using eval(something)= was deprecated if I remember correctly. [SIZE=1]was it? I think it was…[/SIZE]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 2:26pm UTC](https://forum.kirupa.com/t/general-question/6775/6 "2002-10-16T14:26:00Z")

</div>

actually, eval(something)=x

is more than just deprecated, it doesn’t work at all in flash mx! you can’t evaluate a variable and assign it something. you’d have to say:

mything=eval(something);  
mything=x;

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 2:37pm UTC](https://forum.kirupa.com/t/general-question/6775/7 "2002-10-16T14:37:18Z")

</div>

i am newbie but about the eval function, i think it is very useful in flash, most because in can concatenate a string to a int ad this is very useful when for example you want to do a search in flash searching words on a .txt file that contais variables…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 2:44pm UTC](https://forum.kirupa.com/t/general-question/6775/8 "2002-10-16T14:44:27Z")

</div>

Bit \>\> So it’s bad :evil:  
Gabriel \>\> But it has utilities, for sure. But nothing you can’t do with something else. :cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 2:55pm UTC](https://forum.kirupa.com/t/general-question/6775/9 "2002-10-16T14:55:09Z")

</div>

i dont think its bad, for some things is the eval function is the best, many problems that i have in flash i resolve it whith the eval, probably we can do the same things in other way, but that way cannot be the most optimized…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 16, 2002, 3:03pm UTC](https://forum.kirupa.com/t/general-question/6775/10 "2002-10-16T15:03:19Z")

</div>

i don’t think it’s inherantly “bad”, but it’s true that anything you can do with eval, you can do in another, possibly better way. as i said, i never use it personally.
