7. Adding Objects Drag an instance of a symbol to the stage Name the instance: myObject Now you have an object that you can refer to in your code:myObject.x = 100;
9. Dragging Use functions to both start and stop the dragging as well as to add new event listeners: private function startDragging(event:MouseEvent) {stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);myCircle.startDrag();}private function stopDragging(event:MouseEvent) {stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);myCircle.stopDrag();} The event listeners are added to the stage just in case the user moves around too quickly or somehow is not on the object when clicking or releasing the mouse.
11. Throwing Velocity To throw an object you want to make sure the values for velocity (moveX and moveY) are updated according to the where the user has moved the object and it’s change in location over time. private function trackVelocity(event:Event):void { moveX = myCircle.x - oldX; moveY = myCircle.y - oldY; oldX = myCircle.x; oldY = myCircle.y; }
12. Homework, due Oct 14 Create a Title and Description for your final project Create a new frame by frame animation Move your animation using scripts