Mouse Events & Keyboard Inputs Flash ActionScript Introduction to Thomas Lövgren

Slides:



Advertisements
Similar presentations
Event Handling in flash Event: is an instantaneous occurrence usually triggered by user. هو احداث تقع فورا وتطلق عادة باستخدام المستخدم Event: is an instantaneous.
Advertisements

Create a Simple Game in Scratch
Creating & Editing Tables Keyboarding 1A. To Create a Table: From the Menu Bar, select Table select Insert select Table Type in the number of columns.
Create a Simple Game in Scratch
Thomas Lövgren, Flash developer
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Microsoft® Small Basic
Harry Potter Scratch Game
Adventures in Animation Harry Potter Game Pranali Choubal Kunal Shaw Barb Ericson Dec 2007.
User Interface Testing TPTL MRA. Layout 1 You will navigate through this form using the arrow keys. The drop down lists will be displayed by pressing.
Tutorial 15 Working with the Event Model. XP Objectives Compare the IE and W3C event models Study how events propagate under both event models Write a.
ABC’s of PowerPoint (Office 2007) Part 1: Basic Vocabulary Part 2: Cursors Part 3: Insert Your Text Part 4: Insert Your Pictures Part 5: Basic Tools &
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Events (Listeners/Handlers: Mouse, keyboard, timer) Flash ActionScript 3.0 Introduction to Thomas Lövgren, Flash developer
Find your video on youtube e.g. Place the work ‘kick’ in the url.
PowerPoint Tutorial. Basic Vocabulary ► Slide - Presentation - Slide layout – ► ► ► a single page in PowerPoint all the slides for a speech all the slides.
MovieClips & Properties Flash ActionScript Introduction to Thomas Lövgren
Customizing Your Toolbars in Microsoft Office Lunch and Learn: June 7, 2005.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Mastering Your Word Processing Skills
Animations Flash ActionScript Introduction to Thomas Lövgren
Chapter 3 Working with Symbols and Interactivity.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington GUI and the UI API COMP.
Enter the EMR – Other Reports is the most common panel where scanned documents reside Click on camera of the report/document you would like to view to.
Interface & navigation (How to build a simple presentation interface) Flash ActionScript Introduction to Thomas Lövgren
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 2 "The games of a.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script "The games of a people reveal.
Work with Variables Section 5. Add a variable Click on the top grey portion of the GPA column to highlight the column. At the top left of your screen,
PHP Form Introduction Getting User Information Text Input.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script 9 "The games of a.
STAGE 16: FLAPPY. OBJECTIVES  Match blocks with the appropriate event handler  Create a game using event handlers  Share a creative artifact with other.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 9 "The games of a people reveal.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
FOCUS II Demonstration Simply click the mouse to advance through the presentation. Or; Tap the right arrow key on the keyboard to advance through the slides.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Today we are learning to: Understand how actions and events control our game. Completing the catch the clown game – making a room – adding music Gather.
5 th and 4 th ed: some from chapters 9, 12, 13 SY306 Web and Databases for Cyber Operations Slide Set #8: Dynamic HTML.
7. JavaScript Events. 2 Motto: Do you think I can listen all day to such stuff? –Lewis Carroll.
5 Event Handling Interactive Programming Suggested Reading Interaction: Events and Event Handling, Supplemental Text for CPSC 203 Distributed this term.
CISC 110 Day 6 Introduction to Events. Outline Event-Driven Programming Event Classes Hierarchy –Event Class –Mouse Events –Keyboard Events Registering.
JavaScript Events.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Word 2010 Text Basics In this lesson you'll learn the basics of working with text, including how to insert, delete, select, copy, cut, paste, and replace.
CISC 110 Day 7 “The Outliers, Part1” hitTest(), Text Input, Frame and Timer Loops, Publishing Flash Content.
Word 2010 Headers and Footers You can make your document look professional and polished by utilizing headers and footers. The header is a section of the.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script "The games of a people.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
Creating a UFO Rescue Game in Alice
Open a BLANK WORD document
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
ActionScript Basics 2016 (2.0 – 3.0)
Flash Demonstration – Unit 5 – ActionScript 2.0
CHAPTER FIVE Decision Structures.
Introduction to Events
Creating a UFO Rescue Game in Alice
Scratch for Interactivity
JavaScript Events.
Flash Demonstration – Unit 5
Creating a Simple Game in Scratch
Presentation transcript:

Mouse Events & Keyboard Inputs Flash ActionScript Introduction to Thomas Lövgren

Mouse Events & methods The movieClips keep track of mouse position through the properties _xmouse and _ymouse The movieClips keep track of mouse position through the properties _xmouse and _ymouse trace("xMouse:" + _root._xmouse + " yMouse:" + _root._ymouse); Show Mouse cursor Show Mouse cursorMouse.show(); Hide Mouse cursor Hide Mouse cursorMouse.hide();

Mouse Events & methods In order to catch Mouse events an event listener must be created In order to catch Mouse events an event listener must be created Mouse events: Mouse events:  onMouseDown  onMouseUp  onMouseMove  onMouseWheel //get mouse position _root.onMouseMove = function(){ xMouse = _xmouse; yMouse = _ymouse; }

Mouse Event Listener Mouse events can be caught by event handlers Mouse events can be caught by event handlers Example: create an Event Listener for the Mouse Example: create an Event Listener for the Mouse Step 1: create an Object Step 2: create an event handler Step 3: call addListener() var mouseListener:Object = new Object(); mouseListener.onMouseDown = function():Void{ trace("Mouse down"); }Mouse.addListener(mouseListener);

Drag & drop Drag and drop a movieClip with the mouse (left click) Drag and drop a movieClip with the mouse (left click) //click/drag the circle circle_mc.onPress = function(){ //startDrag(target, lockcenter, left, top, right, bottom) startDrag(this, false, 25, 25, 500, 375); } //release the circle circle_mc.onRelease = circle_mc.onReleaseOutside = function(){ this.stopDrag(); //stop drag }

Hitdetection The hitTest() method could be used for hitdetection between movieClips The hitTest() method could be used for hitdetection between movieClips //check detection if (circle_mc.hitTest(square_mc)){ hit_txt.text = "Hit!" }else{ hit_txt.text = "Not hit!" }

Keyboard Inputs Why Use Keyboard Input? Why Use Keyboard Input?  One big reason is accessibility (navigation, forms, games etc)  Many computer users are very accustomed to using the Enter (Return) key for a variety of things var keyListener:Object = new Object(); keyListener.onKeyDown = function() { //check if Enter key is pressed if (Key.isDown(Key.ENTER)){ keyOutput = "Enter press"; //trace ("Virtual key code: "+Key.getCode()+" (ENTER key)"); }} Key.addListener(keyListener); // add the listener

Keyboard Inputs Navigation example: Navigation example: Using the Arrow keys to navigate var KeyListener:Object = new Object(); KeyListener.onKeyDown = function():Void { if(Key.isDown(Key.LEFT)){ _root.sections.gotoAndStop(“sound”); //goto sound section }Key.addListener(KeyListener);

Keyboard & Usability Example using tabs and the setFocus function Example using tabs and the setFocus function //set focus on text field Selection.setFocus(name_txt); //set up the tab index name_txt.tabIndex = 1; city_txt.tabIndex = 2; _txt.tabIndex = 3; send_btn.tabIndex = 4;