# Asfunction and string question

**URL:** https://forum.kirupa.com/t/asfunction-and-string-question/184790
**Category:** Uncategorized
**Created:** [April 7, 2006, 7:50pm UTC](https://forum.kirupa.com/t/asfunction-and-string-question/184790 "2006-04-07T19:50:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rockstar](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Rockstar](https://forum.kirupa.com/u/Rockstar)
#### Post date: [April 7, 2006, 7:50pm UTC](https://forum.kirupa.com/t/asfunction-and-string-question/184790/1 "2006-04-07T19:50:28Z")

</div>

I’m trying to pass 2 parameters from asfunction, so I do a split (array) method, the result i have param0 and param1

I trace param1 and it gives me this result (param1 contains a path to an object):

```auto
trace(param1) // output: _level0.room_mc.cube_0

```

The problem is when I try to trace the \_x position of that object, I got an Undefined.

```auto
trace(param1._x) // output: UNDEFINED

```

My question now is… is param1 a string? do I have to conver it into a variable? If not, is there any work around?

THANKS ALOT!

This is my code as a whole:

```auto

<a href='asfunction:_root.receipt,"+pathObj+"|"+theObj+"'>"+theObj+"</a>

function receipt(param) {
	argument_array = new Array();
	argument_array = param.split("|");
	for (i=0; i<argument_array.length; i++) {
		param = argument_array;
		this['param'+i] = param*;
	}
	trace(param1); // output: _level0.room_mc.cube_0
        trace(param1._x); //output: UNDEFINED
}

```

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 8, 2006, 12:32am UTC](https://forum.kirupa.com/t/asfunction-and-string-question/184790/2 "2006-04-08T00:32:20Z")

</div>

All of the parameters passed are of type String:

```auto
theObj = mc;
pathObj = mc;
txt.htmlText = "<a href='asfunction:receipt," + pathObj + "|" + theObj + "'>" + theObj + "</a>";
function receipt(param) {
 argument_array = param.split("|");
 for (i = 0; i < argument_array.length; i++) {
  this['param' + i] = argument_array*;
 }
 trace(param1);
 trace(eval(param1)._x);
}

```

🙂
