# Converting String to Object

**URL:** <https://forum.kirupa.com/t/converting-string-to-object/303930>\
**Category:** Uncategorized\
**Created:** [January 29, 2010, 4:56am UTC](https://forum.kirupa.com/t/converting-string-to-object/303930 "2010-01-29T04:56:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfink](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@bfink](https://forum.kirupa.com/u/bfink)\
**Post date:** [January 29, 2010, 4:56am UTC](https://forum.kirupa.com/t/converting-string-to-object/303930/1 "2010-01-29T04:56:23Z")

</div>

I’m using TweenLite for my Tweens. The constructor takes the form TweenLite(targetDisplayObject, duration, object). The third parameter specifies the parameters of the tween, in the form {x:100,y:100,ease:Back.easeIn} etc. What I want to do is this:

```auto

var str:String = "{x:100,y:100,rotation:Math.random()*360}";
var obj:Object = convertToObject(str);
var tween:TweenLite = new TweenLite(mc,2,obj);

```

Any suggestions or solutions for a convertToObject function? I need to be able to have math functions (+,-,\*,/,Math.random(), etc).
