470 likes | 596 Views
Events and Conditions. Events are things that happen. Onpress () Videos loaded Mouse click. Event Handlers. Something that runs when a certain event occurs. Open Events.fla. Select the first keyframe of actions layer and f9. Keyboard Control to Character.
E N D
Events are things that happen • Onpress() • Videos loaded • Mouse click
Event Handlers • Something that runs when a certain event occurs.
Keyboard Control to Character • 1st thing to do is to add an event listener. Tells an object to wait for a particular event to happen. • Set the keypress to the stage and not the boarder..
Evt—represent the event the occurred.. Data sent to the function when a key is pressed.
Explain Event listener– connect event Event And c command
Conditions– Programs that think and make decisions. • Open Conditions.fla
If a condition is met run a block of code First frame f9
If the key was press was RIGHT Talk about evt
Another way… Select the if block and delete
Switch case Check the value of the keycode and do different things based on the value.