# In-line evaluation

**URL:** <https://forum.kirupa.com/t/in-line-evaluation/65488>\
**Category:** flash\
**Created:** [September 27, 2004, 1:13am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488 "2004-09-27T01:13:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GW02](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GW02](https://forum.kirupa.com/u/GW02)\
**Post date:** [September 27, 2004, 1:13am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/1 "2004-09-27T01:13:06Z")

</div>

Is there any function in flash that allows for ‘in-line evaluation’?

For example, in php I can type

eval ( ‘php statement here’ );

and php will execute ‘php statement here’ as if I typed it as a command. I’m trying to execute dynamic code is the problem.

---

<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:** [September 27, 2004, 3:48am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/2 "2004-09-27T03:48:43Z")

</div>

i am not exactly following you here…

hmm… there is an eval statement in actionscript, though.

---

<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:** [September 27, 2004, 3:50am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/3 "2004-09-27T03:50:39Z")

</div>

* * *

[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary200.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary200.html)

* * *

---

<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:** [September 28, 2004, 1:31am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/4 "2004-09-28T01:31:43Z")

</div>

Right, I know of that one, but it doesn’t provide the desired effect.

That eval statement lets you pass a string and it will treat the string like an object reference in your code.

I want one that lets you pass a string and it will execute the string like a line of code.

For example:

* * *

## execstring = "somevariable = Math.PI \* anothervariable" if ( some condition ) execstring += " ^2;" else execstring += ";" eval ( execstring );

And have it treat the string execstring as if it was a statement.

It’s not a very good example but it gets the point across.

---

<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:** [September 29, 2004, 12:52am UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/5 "2004-09-29T00:52:14Z")

</div>

Anyone?

---

<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:** [September 29, 2004, 7:12pm UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/6 "2004-09-29T19:12:38Z")

</div>

asked this question awile ago (i went for the _toCode(someString)_ approach ;)) no replies tho. also recall a similar questin a long time ago so i think the answer here is…

no…

unfortunately…

Prophet.

---

<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:** [September 29, 2004, 7:40pm UTC](https://forum.kirupa.com/t/in-line-evaluation/65488/7 "2004-09-29T19:40:55Z")

</div>

No, there isn’t.
