# Variable Dynamic Object

**URL:** <https://forum.kirupa.com/t/variable-dynamic-object/286788>\
**Category:** flash\
**Created:** [April 21, 2009, 12:43am UTC](https://forum.kirupa.com/t/variable-dynamic-object/286788 "2009-04-21T00:43:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpgenius](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cpgenius/32/854_2.png) [@cpgenius](https://forum.kirupa.com/u/cpgenius)\
**Post date:** [April 21, 2009, 12:43am UTC](https://forum.kirupa.com/t/variable-dynamic-object/286788/1 "2009-04-21T00:43:59Z")

</div>

Hey,

I’m trying to reference a dynamic variable for PayPal but can’t seem to find the right function for it. Here’s an example:

```auto
_global.paypalObj = new Object();
paypalObj.item_name_1 = 'Book';
paypalObj.amount_1 = '7.99';
paypalObj.quantity_1 = txtBookQ.text;
paypalObj.shipping_1 = '1.95';

```

The problem is I need to replace the "1"s after .item\_name\_ , amount\_ etc. with a variable such as “i”.

Normally, I’d mess with this[] or eval() but I’m not sure how to do it.

Anyone have any ideas?

Thanks,  
Nick
