Permalink
Browse files

small changes to make it possible to extend

  • Loading branch information...
1 parent 368f0f6 commit 5efd9baba9c660f9368a37853e85bf38df5cf002 @seanhess committed Jun 3, 2009
Showing with 14 additions and 6 deletions.
  1. +14 −6 source/src/net/seanhess/glue/tags/Action.as
View
20 source/src/net/seanhess/glue/tags/Action.as
@@ -58,19 +58,27 @@ package net.seanhess.glue.tags
watch.addEventListener(name, handler);
}
- private function handler(event:Event):void
+ protected function handler(event:Event):void
{
removeListeners();
-
+ updateScope(event);
+ runActions(event);
+ }
+
+ protected function updateScope(event:Event):void
+ {
var scope:Scope = new Scope();
scope.parent = Scope.current;
scope.event = event;
- scope.target = watch; // wait, what's wrong with this?
+ scope.target = watch;
- Scope.current = scope;
-
+ Scope.current = scope;
+ }
+
+ protected function runActions(event:Event):void
+ {
for each (var action:Action in listeners[event.type])
- action.execute();
+ action.execute();
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

0 comments on commit 5efd9ba

Please sign in to comment.