
Код AS3:
package
{
import flash.events.Event;
public class CustomEvent extends Event
{
private var _total:int;
public static const CHANGE:String = "Custom.change";
public function CustomEvent(type:String, _total:int, bubbles:Boolean = false, cancelable:Boolean = false)
{
super(type, bubbles, cancelable);
_total = _total;
}
public function get total():int
{
return _total;
}
}
}

Код AS3:
addEventListener(CustomEvent.CHANGE, onChange);
function onChange(e:CustomEvent):void
{
trace(e.total);
}