Created
October 7, 2012 23:13
-
-
Save cflewis/3849926 to your computer and use it in GitHub Desktop.
This file contains 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
protected function targetButton_dragDropHandler(event:DragEvent):void | |
{ | |
var draggedButton:Button = event.dragInitiator as Button; | |
var droppedOnButton:IVisualElement = event.currentTarget as IVisualElement; | |
var newButton:Button = new Button(); | |
var parent:Group = droppedOnButton.parent as Group; | |
// Set up the new button | |
newButton.label(draggedButton.label); | |
newButton.color(draggedButton.color); | |
parent.addElementAt(newButton, parent.getElementIndex(droppedOnButton)); | |
parent.removeElement(droppedOnButton); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This barfs with:
Description Resource Path Location Type
1061: Call to a possibly undefined method color through a reference with static type spark.components:Button. DragDrop line 38 Flex Problem
1119: Access of possibly undefined property color through a reference with static type spark.components:Button. DragDrop line 38 Flex Problem
1195: Attempted access of inaccessible method label through a reference with static type spark.components:Button. DragDrop line 37 Flex Problem