# Construct a reference to variable

**URL:** <https://forum.kirupa.com/t/construct-a-reference-to-variable/273041>\
**Category:** Uncategorized\
**Created:** [October 10, 2008, 2:15pm UTC](https://forum.kirupa.com/t/construct-a-reference-to-variable/273041 "2008-10-10T14:15:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [October 10, 2008, 2:15pm UTC](https://forum.kirupa.com/t/construct-a-reference-to-variable/273041/1 "2008-10-10T14:15:28Z")

</div>

i’ve got an array consisting of variable names (actually papervision primitives).

```auto
	var homeObjs:Array = new Array(plane1, plane2, plane3);

```

very simple.

later i want to pass the array into a function to do the same thing (tween) to all primitives.  
The primitives animate out to specific x and y coords., so i need to reference those and am attempting to make variables to pass to tween like this:

```auto
clipY = [threeDobjArray*.toString+"yOut"];
clipX = [threeDobjArray*.toString+"xOut"];

```

I’ve got these variables defined earlier:

```auto
var plane1yOut:Number = -600;
	var plane1xOut:Number = -900;

		var plane2yOut:Number = 600;
		var plane2xOut:Number = 900;

		var plane3yOut:Number = -600;
		var plane3xOut:Number = 900;

```

ultimately want to pass them into this:

```auto
			Tweener.addTween(clip, {rotationX:540, rotationY:360, z:300, y:clipY, x:clipX, alpha:0, transition:"easeInOutQuad", time:1.5});

```

i’m not creating my variable name properly and can’t figure out what i’m doing wrong! help!
