/*
 *  Copyright 2010 Chet Haase
 *    
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *    
 *    http://www.apache.org/licenses/LICENSE-2.0
 *    
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package utils
{
import flash.events.EventDispatcher;

import mx.core.IVisualElement;

import spark.effects.animation.Animation;
import spark.effects.animation.IAnimationTarget;

[Event("start", type="utils.AnimationEvent")]
[Event("stop", type="utils.AnimationEvent")]
[Event("end", type="utils.AnimationEvent")]
[Event("repeat", type="utils.AnimationEvent")]
[Event("update", type="utils.AnimationEvent")]

public class AnimationTargetDispatcher extends EventDispatcher implements IAnimationTarget
{
    public function animationStart(animation:Animation):void
    {
        dispatchEvent(new AnimationEvent(AnimationEvent.START, animation));
    }
    
    public function animationStop(animation:Animation):void
    {
        dispatchEvent(new AnimationEvent(AnimationEvent.STOP, animation));
    }
    
    public function animationEnd(animation:Animation):void
    {
        dispatchEvent(new AnimationEvent(AnimationEvent.END, animation));
    }
    
    public function animationRepeat(animation:Animation):void
    {
        dispatchEvent(new AnimationEvent(AnimationEvent.REPEAT, animation));
    }
    
    public function animationUpdate(animation:Animation):void
    {
        dispatchEvent(new AnimationEvent(AnimationEvent.UPDATE, animation));
    }
    
}
}