-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme
43 lines (28 loc) · 820 Bytes
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Signaller ActionScript library.
Signal represents an event and allows to listen for it.
Signaller is a wrapper on Singal class. It gives the ability to dispatch events.
Both this classes are implement ISignal interface.
Typical usage:
class Ticker
{
private const _onTick:Signaller = new Signaller();
public const onTick:Signal = _onTick.signal;
private function doSomething():void
{
...
_onTick.dispatch("tick!");
}
}
class TickerManager
{
public function workWithTicker(ticker:Ticker):void
{
ticker.onTick.add(handleTick);
// It's impossible to dispatch onTick signal from outside of the ticker
// ticker.onTick.dispatch() - will fail
}
private function handleTick(tickerMessage:String):void
{
ticker.onTick.remove(handleTick);
}
}