---
id: 1394
title: Mate... Lightweight Schedule Extension
slug: mate-schedule-actionlist
date: '2009-05-30T14:11:09Z'
modified: '2009-05-30T14:11:09Z'
status: publish
type: post
author: pmoelgaard
categories:
  - ActionScript 3.0
tags:
  - Code
  - Mate Flex Framework
excerpt: null
canonicalPath: /posts/mate-schedule-actionlist
featuredImage: null
commentCount: 0
wordCount: 219
readingTimeMinutes: 1
hasMedia: false
hasVideos: false
url: 'https://forwardthinking.pemo.me/posts/mate-schedule-actionlist'
---
Some time ago I was in need of something to be run at regular intervals. Among the many implementations I already had in my framework, I thought that including either my Workflow package (An ActionScript port of the Windows Workflow Foundation 3) or my processing package (eventually just a scheduling application block which allows processes to be managed Windows Service style. I wanted something much more lightweight, so I decided to implement a Schedule Handler. It extends the AbstractHandlers class, so all I had to do was initiate a timer and then run the sequence when the timer elapsed... more lightweight then that is hard to imagine.

```jscript

package org.hellogroup.mate.actionLists
{
	import com.asfusion.mate.actionLists.AbstractHandlers;
	import com.asfusion.mate.actionLists.Scope;

	import flash.events.TimerEvent;
	import flash.utils.Timer;

	public class Schedule extends AbstractHandlers
	{
		private var timer:Timer = null;

		public function Schedule()
		{
			super();

			this.timer = new Timer( 1000 );
			this.timer.addEventListener( TimerEvent.TIMER, this.handleTimer );
		}

		[Bindable]
		public function get delay() : Number
		{
			return timer.delay;
		}

		public function set delay( value:Number ) : void
		{
			this.timer.delay = value;
		}

		override public function initialized( document:Object, id:String ) : void
		{
			super.initialized( document, id );

			this.timer.start();
		}

		private function handleTimer( event:TimerEvent ) : void
		{
			this.runSequence( new Scope( event, true, this.map ), this.actions );
		}
	}
}
```

The class is included in the downloads in my previous post... [http://blog.petermolgaard.com/2009/05/30/mate-stopanddispatchhandlers-extension/](http://blog.petermolgaard.com/2009/05/30/mate-stopanddispatchhandlers-extension/)
