Created
July 8, 2009 14:23
-
-
Save camwest/142877 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.yardstick.shared.ui.controls | |
| { | |
| import com.yardstick.shared.events.ActionPanelEvent; | |
| import flash.events.MouseEvent; | |
| import spark.components.Panel; | |
| import spark.components.supportClasses.ButtonBase; | |
| [Event(name="action", type="com.yardstick.shared.events.ActionPanelEvent")] | |
| public class ActionPanel extends Panel | |
| { | |
| //-------------------------------------- | |
| // Constructor | |
| //-------------------------------------- | |
| public function ActionPanel() | |
| { | |
| super(); | |
| addHandlers(); | |
| } | |
| //-------------------------------------- | |
| // Skin Parts | |
| //-------------------------------------- | |
| [SkinPart(required="true")] | |
| public var actionButton:ButtonBase; | |
| //-------------------------------------- | |
| // Protected Methods | |
| //-------------------------------------- | |
| protected function addHandlers():void | |
| { | |
| actionButton.addEventListener(MouseEvent.CLICK, actionEventHandler, false, 0, true); | |
| } | |
| //-------------------------------------- | |
| // Event Handlers | |
| //-------------------------------------- | |
| private function actionEventHandler(e:MouseEvent):void | |
| { | |
| dispatchEvent( new ActionPanelEvent( ActionPanelEvent.ACTION ) ); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment