           notificationManager.applicationBadgeNumber = 0;
           printMessage("Reset badge number to zero");
           break;
+        case clearButton:
+          clearMessages();
+          break;
       }
     }
 

      cancelButton = createButton("Cancel", stage.stageWidth - 100 * contentsScaleFactor, top1);
      codeButton = createButton("By Code", 0, top2);
      badgeButton = createButton("Clear Badge", stage.stageWidth - 100 * contentsScaleFactor, top2);

      addChild(postButton);
      addChild(cancelButton);
      addChild(codeButton);
      addChild(badgeButton);

      notificationTF = createTextField(0, int(stage.stageHeight / 2),
         stage.stageWidth - 1, int(stage.stageHeight / 2) - 1);

    private var cancelButton:SimpleButton;
    private var codeButton:SimpleButton;
    private var badgeButton:SimpleButton;
    private var clearButton:SimpleButton;
    private var notificationTF:TextField;
    private var contentsScaleFactor:int = 2;

