Articles in the managers Category
AS3, General game programming, flash, managers »
First of all, to understand the need of a centralized manager for filters in flash, we need to understand how filters are set on a DisplayObject.
To set a filter, we first need to create a BitmapFilter object :
// create a new blur filter
var blur:BlurFilter = new BlurFilter(4.0, 4.0, 1);
Then add it to the “filters” property (which is an array) of a DisplayObject like so:
// get a copy of the "filters" array
var aFilters:Array = displayObject.filters;
// add our filter to our new array
aFilters.push(blur);
// and set our new array
displayObject.filters = aFilters;
Why do we …
AS3, General game programming, managers »
What for ?
Events centralization allows to listen for events of an object that we don’t have direct access to.
Example
We have a button in a MovieClip that is not directly connected to your main MovieClip or class where you want to keep all the events logic. There are many ways to get the reference of your button but if you only need to listen for its events then there is a simple way.
Events centralization
The core of the centralization system is a Singleton (some sort of …
AS3, managers »
I know, this is not a big thing but it can save a lot of “after-work” when you just know that it can be really useful and save you a lot of time.
I say “after-work” because I understood its importance after I thought I had finished a Loaders management class. I had to rewrite all the event parts.
So what is it ?
Just a method that clones the custom event instance with all the custom properties associated to it.
Why is it so important ?
Well, the clone() method is not necessary in …
AS3, Game, General game programming, Network programming, Strange/Bugs, managers »
Basic Events manager classes. Remove all events, group events, suspend and resume events…
Features
Keep track of all events added and removed with this manager.
Add listener.
Remove listener.
Add a listener to one or more groups.
Suspsend a listener and/or a group of listeners without removing them.
Resume a listener and/or a group of listeners.
Remove all listeners from a group.
Remove all listeners.
For what purpose ?
Well, frankly, those events are sometimes a pain in the arse to manage.
Let’s say we have a bunch of buttons we just want to disable for some period of time and then …





