Skip to content

Instantly share code, notes, and snippets.

@camwest
Created July 8, 2009 14:23
Show Gist options
  • Select an option

  • Save camwest/142877 to your computer and use it in GitHub Desktop.

Select an option

Save camwest/142877 to your computer and use it in GitHub Desktop.
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