Events - - e:MouseEvent- e: is an instance variable -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Example Code: -upArrow.addEventListener(MouseEvent.CLICK, goUp) -private var currentCar:Car What are events? -when something happens. .. -user inputs - when the user interacts with the program mouse, keyboard, wii, touch -system events - when flash does something, the program reacts any time flash does something for you, like moving the frame -object interactions Why specify the event type? -mainly for speed Why do you need to specify a function name in the addEventListener function? -you need to define a function for the event, -when the event takes place, the program knows what to do - What does upArrow do? -what listens for an event What parameter is needed for your event listener to function?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: - e:MouseEvent- e: is an instance variable - MouseEvent is the type of event to listen for (MouseEvent is a class) Why was the Current Car defined in CarLot?-CurrentCar is a variable - it allows the program to use several cars- and choose one at a time to move-CarLot is the document class - the document class is the class where everything on the stage happens - so thats the proper location for a specific reference to what is on the stage Why is the event listener that selects a car defined in the Car class?- its the class that knows the most about the specific car - so it knows what to do with it specifically...
View Full Document

Ask a homework question - tutors are online