Hi!
I’ve got a problem and would be very glad for your help.
I’ve got an array, events, where I store objectdata, such as
events.id (String), events.action (String) and events.time (Number).
In a for-loop, I want to go through the array and for each object I want to connect a Timer which runs the function “takeIt” which runs the public function “newEvent”. The object in the array, events.id contains information about the object which is running newEvent, and in the array, events.action there are alse information which action to use. The events*.time contains information about the timer delay which seems to work.
How should I write this to make it work?
for (var i:int = 0; i < events.length; i++) {
function takeIt(e:TimerEvent) {
//this I need help width
** events[id].newEvent(this[action]);**
//could be
video1.newEvent("Start");
//var
}
var timer:Timer = new Timer(events*.time, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, takeIt);
timer.start(); }
Happy new year
Regards Simon