消息拦截器(MessageInterceptors)

public class DeleteItemInterceptor {

[MessageInterceptor(type="com.bookstore.events.ShoppingCartDeleteEvent")]
public function interceptDeleteEvent (processor:MessageProcessor) : void {
        var listener:Function = function (event:CloseEvent) : void {
            if (event.detail == Alert.OK) {
                processor.proceed();
            }
          };     
          Alert.show("Do you really want to delete this item?", "Warning",
            Alert.OK | Alert.CANCEL, null, listener);
    }

}

你可能感兴趣的:(Interceptor)