# What have I missed here?

**URL:** <https://forum.kirupa.com/t/what-have-i-missed-here/60979>\
**Category:** flash\
**Created:** [August 14, 2004, 2:05pm UTC](https://forum.kirupa.com/t/what-have-i-missed-here/60979 "2004-08-14T14:05:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dal\_platinum](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@dal\_platinum](https://forum.kirupa.com/u/dal_platinum)\
**Post date:** [August 14, 2004, 2:05pm UTC](https://forum.kirupa.com/t/what-have-i-missed-here/60979/1 "2004-08-14T14:05:19Z")

</div>

Hi guys.

I’m trying to create an array, and this is the code I’m using:

```auto
function create_spiral(len, rad, turns, num, theArray) {
 theArray = [];
 var inx = len/num;
 var iny = ((360*turns)*(Math.PI/180))/num;
 var inz = iny;
 var curx = 0;
 for (var i = 0;i<num;i++) {
  curx += inx;
  cury = Math.sin(iny*i)*rad;
  curz = Math.cos(inz*i)*rad;
  theArray* = [curx, cury, curz]
 }
 trace("done")
}

```

and I’m calling it with:

```auto
create_spiral(200, 10, 3, 100, points)

```

ideally, I would then have an array, called points, which would be full of numbers.

but when I run a trace it shows as undefined.

I can’t work out for the life of me what I’ve missed, but I’m sure it’s something daft.

Any ideas?

---

<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:** [August 15, 2004, 4:25am UTC](https://forum.kirupa.com/t/what-have-i-missed-here/60979/2 "2004-08-15T04:25:07Z")

</div>

[AS]function create\_spiral(len, rad, turns, num, theArray) {  
\_root[theArray] = [];

var inx = len/num;  
var iny = ((360_turns)_(Math.PI/180))/num;  
var inz = iny;  
var curx = 0;  
for (var i = 0;i\<num;i++) {  
curx += inx;  
cury = Math.sin(iny\*i)_rad;  
curz = Math.cos(inz_i)_rad;  
\_root[theArray]_ = [curx, cury, curz];  
}  
//trace(“done”)  
}  
create\_spiral(200, 10, 3, 100, “points”);[/AS]  
when you are giving a hard-coded param, remember to put the “”

---

<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:** [August 15, 2004, 8:04am UTC](https://forum.kirupa.com/t/what-have-i-missed-here/60979/3 "2004-08-15T08:04:05Z")

</div>

excellent, thanks.

here is the end result: - [http://dalplatinum.com/3dblobs2.html](http://dalplatinum.com/3dblobs2.html)
