---
id: 1605
title: MATE CacheSetter.. a quick and dirty introduction
slug: mate-cachesetter-a-quick-and-dirty-introduction
date: '2009-07-16T21:48:42Z'
modified: '2009-07-16T21:48:42Z'
status: publish
type: post
author: pmoelgaard
categories:
  - ActionScript 3.0
  - Adobe Flex
tags:
  - Code
  - Code Design
  - Mate Flex Framework
  - Undocumentation
excerpt: null
canonicalPath: /posts/mate-cachesetter-a-quick-and-dirty-introduction
featuredImage: null
commentCount: 13
wordCount: 237
readingTimeMinutes: 2
hasMedia: false
hasVideos: false
url: >-
  https://forwardthinking.pemo.me/posts/mate-cachesetter-a-quick-and-dirty-introduction
---
One of the newer classes in the MATE Flex Framework yet to be documented is the CacheSetter. It's nothing overly fancy, but it does exactly what it promises... it allows you to set the Cache from an ActionTag. Let's examine the code below... it's a standard MATE EventMap with a couple of eventhandlers which offers to exit an AIR application when the User clicks anywhere on it... the applications for such a feature might be quite limited, but that's what I could think of at 4:40 AM in Bangkok after almost 2 hours of being teleconferencing with the Flex Team sitting in California and it proves the point with the CacheSetter close to a minimal implementation. *NativeSystemEventMap.mxml*

For the sake of completion, I will also bring the code to the AIR application itself...

```jscript

<s>

	
		
	

</s>
```

One of the more interesting and intricate details (and eventually why this exercise is interesting), is to see that it uses the Class reference as the cacheKey and that you eventually would be able to use any class or hashable object and chain as the cacheKey. If the cacheKey is NOT set explicitly it will default to use the class type of the Generator attribute, but if you are working with MATE the Cache class is one of the classes it makes the most sense to take an extra look at... **CacheSetter (Source)** [http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/actions/CacheSetter.as](http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/actions/CacheSetter.as) **Cache (Source)** [http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/core/Cache.as](http://code.google.com/p/mate-framework/source/browse/trunk/src/com/asfusion/mate/core/Cache.as) **Cache (Documentation** [http://mate.asfusion.com/api\_docs/com/asfusion/mate/core/Cache.html](http://mate.asfusion.com/api_docs/com/asfusion/mate/core/Cache.html)
