public string Trigger = MouseEvent.ROLL_OVER; // default // fires after the GUI component is instantiated void ComponentInstantiated(Component component) { //Slider slider = (Slider) component; // you can do a cast here component.AddEventListener(Trigger, delegate(Event e) { Factory.Play(e.Target); }, EventPhase.Target); }