# Passing array data to timer function

**URL:** <https://forum.kirupa.com/t/passing-array-data-to-timer-function/317429>\
**Category:** Uncategorized\
**Created:** [December 20, 2010, 2:22pm UTC](https://forum.kirupa.com/t/passing-array-data-to-timer-function/317429 "2010-12-20T14:22:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tristessa](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tristessa](https://forum.kirupa.com/u/tristessa)\
**Post date:** [December 20, 2010, 2:22pm UTC](https://forum.kirupa.com/t/passing-array-data-to-timer-function/317429/1 "2010-12-20T14:22:39Z")

</div>

Greetings community…

This might be so simple I kind of feel sorry to post it.  
But, I just can’t bend my mind over it and tackle this with supreme powers ☹  
sad isn’t it…

heres the deal:

in a for loop i am passing 60 movieclips to the stage at runtime.  
now after that I trigger a function that fires every second.  
But inside that timer function, i can not trace what items are in my array  
in other words, every second i want to trigger a movieclip inside the array.  
(this will later destroy a random ipad or iphone processor :p)

heres my code:

```auto

var circle_array:Array;
var seconds_counter:uint = 0;
var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, runSeconds);

function posClips()
{
	for (i=0; i < 60; i++)
	{
		circle_array* = new _dot();//linkage in the library
		circle_array*.alpha = 0;
		circle_array*.x = 0 + (circle_array*.width + 1) *i
		circle_array*.y = (stage.stageHeight/2)
		addChild(circle_array*);
	}
	myTimer.start();
}

posClips();

function runSeconds(event:TimerEvent):void
{
	seconds_counter++;
	trace ("circle_array* = " + circle_array[seconds_counter]);
           //can't find the array

}

```

In AS2 this job was done by now, but in AS3 i duno how to tackle this.  
any pointer is welcome.  
Thanks for your time! seasons greetings 😉
