// Frame Events Example // Adapted from an example in "Learning ActionScript 3.0" by Rich Schupe with Zevan Rosser package { import flash.display.*; import flash.events.*; public class Wk7DragAndDrop extends MovieClip { function Wk7DragAndDrop( ) { cycle1.addEventListener(MouseEvent.MOUSE_DOWN,cycleStartDrag); cycle1.addEventListener(MouseEvent.MOUSE_UP, cycleStopDrag); } // When the user presses the mouse down on cycle1 // the startDrag function is called for it function cycleStartDrag(evt:MouseEvent) { cycle1.startDrag( ); } // When the user presses the mouse down on cycle1 // the startDrag function is called for it function cycleStopDrag(evt:MouseEvent) { cycle1.stopDrag( ); } } }