© 2011 Delmar, Cengage Learning Chapter 10 Using ActionScript to Enhance User Experience.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

INTRODUCTION TO ADOBE FLASH CS4
1What is the Stage. 2How do you open a panel in Flash
© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
© 2010 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
© 2010 Delmar, Cengage Learning Chapter 4 Working with Links.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 18 – Macromedia Flash MX 2004: Building an Interactive Game Outline 18.1 Introduction 18.2 Object-Oriented.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
1 Flash Actionscript Event Handling. 2 Event Handling Right now we know all about variables lets go back to our text input/output example: Suppose we.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
1 Flash Actionscript Adding Interactive Actions Variables.
Macromedia Flash 5 Advanced Level Course. Using Actions Toolbox ListActions List Parameters area Add/Delete a StatementMove Action Up/Down Expand/Collapse.
Macromedia Dreamweaver 4 Advanced Level Course. Add Rollovers Rollovers or mouseovers are possibly the most popular effects used in designing Web pages.
Introduction to Macromedia Flash 8
1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.
CIS101 Introduction to Computing Week 12 Spring 2004.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
© 2010 Delmar, Cengage Learning Chapter 4: Creating Animation.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
Chapter 17 Putting It All Together. Viewing the Preloader To view the preloader, 1.CTRL-Enter to test the movie. 2.View > Simulate Download.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Media and Interactivity with Flash and Spry.
Chapter 3 Working with Symbols and Interactivity.
Chapter 13 Working with Components. Chapter 13 Lessons 1.Use Components in a Flash Movie 2.Use Components in a Form.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
Advanced Level Course. Site Extras Site Extras consist of four categories: Stationeries Site Trash Designs Components.
Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH PROFESSIONAL CS5.
Working with Symbols and Interactivity
Chapter 10 Fireworks: Part II The Web Warrior Guide to Web Design Technologies.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
XP Tutorial 4 Special Animations. XP New Perspectives on Macromedia Flash MX Special Layers for Animation Animation Using a Motion Guide Layer.
7-1 OBJ Copyright 2003, Paradigm Publishing Inc. Using ActionScript and Creating Templates Macromedia Flash Design & Application.
Tutorial 7 Planning and Creating a Flash Web Site.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
© 2011 Delmar, Cengage Learning Chapter 4 Creating Animations.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
XP Tutorial 8 Adding Interactivity with ActionScript.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Macromedia Flash Design Professional And Interactivity WORKING WITH SYMBOLS.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
XP Tutorial 7 Creating a Flash Web Site. XP New Perspectives on Macromedia Flash 82 Objectives Plan and create a Flash Web site Create a Flash template.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Sound and Video.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
XP Tutorial 8 Adding Interactivity with ActionScript.
DM 11- Flash –Unit C and Interactivity WORKING WITH SYMBOLS.
Creating a Flash Web Site
Unit Lessons Work with actions
CT1514 Flash-2.
INTRODUCTION TO ADOBE FLASH CS4
INTRODUCTION TO FLASH ANIMATION
Working with Symbols and Interactivity
Exercise : Animated Navigation Structure in Animate (= Flash)
JavaScript 101 Lesson 8: Loops.
Presentation transcript:

© 2011 Delmar, Cengage Learning Chapter 10 Using ActionScript to Enhance User Experience

Chapter 10 Lessons 1.Create complex interactivity 2.Load movies at runtime 3.Work with conditional actions 4.Use ActionScript to create external links © 2011 Delmar Cengage Learning

Use ActionScript to Enhance User Experience Introduction –You can use ActionScript to enhance the user experience by: 1.Replacing the mouse cursor with a custom cursor 2.Tracking user interactions and offer feedback based on the data you gather 3.Breaking your movies into smaller movies

© 2011 Delmar Cengage Learning Use ActionScript to Enhance User Experience Introduction –Creating conditional actions to implement complex branching in your movies –Creating looping actions to help streamline your ActionScript –Providing a way to repeat a set of actions based on a value provided by the user or on a task you want the user to perform

© 2011 Delmar Cengage Learning Tools You’ll Use Use ActionScript to Enhance User Experience

© 2011 Delmar Cengage Learning Create Complex Interactivity Creating a custom cursor is a fun way for you to make a Flash site distinctive. You can integrate a custom cursor with the purpose of the site. The custom cursor can be a graphic, photograph, or even an animation.

© 2011 Delmar Cengage Learning Create Complex Interactivity When you are implementing a custom cursor, the first step is to hide the regular cursor, using the mouse.hide method. Then you display the custom cursor which means you will have two cursors on the stage, but only the custom cursor is visible.

© 2011 Delmar Cengage Learning Create Complex Interactivity You need to set up an event listener that “listens” for when the mouse moves. Mouse movement is tracked by mouseX and mouseY properties. As the user moves the mouse, the mouseX and mouseY values are updated constantly to reflect the current position.

© 2011 Delmar Cengage Learning Create Complex Interactivity ActionScript to create a custom cursor by setting X and Y coordinates myCursor is the instance name of the custom cursor movie clip symbol The mouse X and Y coordinates are passed to the custom cursor

© 2011 Delmar Cengage Learning Create Complex Interactivity In ActionScript 3.0, you have the ability to reuse lines of code. This is especially applicable to functions (which are made up of blocks of code). You can have one event listener that calls (executes) the same function for more than one object.

© 2011 Delmar Cengage Learning Create Complex Interactivity Three objects that call the same function These three objects call the same function, clickToDrag event.target refers to whichever object calls the function

© 2011 Delmar Cengage Learning Create Complex Interactivity ActionScript includes an if action that can test whether certain conditions have been met and, if so, can perform other actions.

© 2011 Delmar Cengage Learning Create Complex Interactivity Conditional statements offer many possibilities for building more interactive movies. You should enclose all the actions you want Flash to carry out in braces following the if action. If the conditions are not met, the actions in the braces are ignored.

© 2011 Delmar Cengage Learning Create Complex Interactivity Three objects that call the same function This action is only carried out when it is equal to 9

© 2011 Delmar Cengage Learning Create Complex Interactivity The Display list is a list of all the items that will be visible on the screen in a Flash document, including: movie clips, drawn shapes, text fields, videos, and bitmaps. These items are Display Object types.

© 2011 Delmar Cengage Learning Create Complex Interactivity Some of these display objects can have children. It is important, when you are referring to an object in ActionScript, to specify whether an object is a child or a parent.

© 2011 Delmar Cengage Learning Create Complex Interactivity Three objects that call the same function This is checking to see if the mySquare object has been dropped on top of the parent (a movie clip) of the targetSquare object

© 2011 Delmar Cengage Learning Create Complex Interactivity One aspect of interactivity involves responding to user actions, such as jumping to a different point in a movie when a user clicks a button. Another aspect involves providing users with individual feedback based on the actions they take or information they supply.

© 2011 Delmar Cengage Learning Create Complex Interactivity When you collect information it presents many opportunities to offer user custom feedback. When you track interactions it can also provide you with insight on the way people work with your site or application.

© 2011 Delmar Cengage Learning Create Complex Interactivity The increment and decrement actions are useful when you are tracking user interactions. –The increment action ++ (two plus signs) adds 1 unit to a variable or expression –The decrement action - - (two minus signs) subtracts 1 unit

© 2011 Delmar Cengage Learning Load Movies at Runtime When you create multiple movies they create smoother transitions between pages because the new movies load into the current HTML page A Flash site that takes advantage of using multiple movies

© 2011 Delmar Cengage Learning Load Movies at Runtime Using multiple movies can help you keep organized during development of a movie, especially if different people are working on different parts of the movie. You can use the Loader class along with the addChild method to load an external movie, graphic, text block, or sound.

© 2011 Delmar Cengage Learning Load Movies at Runtime When you are creating a link to a file, you can include an absolute path, which specifies the exact location of the file. A relative path indicates the location based on the current location of your movie file.

© 2011 Delmar Cengage Learning Load Movies at Runtime ActionScript for loading an SWF file in the same location as the Flash document Code to load fish.swf file

© 2011 Delmar Cengage Learning Load Movies at Runtime You can load a new movie with the original document or into a movie clip symbol. If you load a movie with the original document, the new movie inherits the frame rate, dimensions, and background color of the original document.

© 2011 Delmar Cengage Learning Load Movies at Runtime You can use the removeChild method to unload movies which will create smoother transitions between movies. When you unload a movie, it is removed from the player but it is still available to be replayed without having to download it again.

© 2011 Delmar Cengage Learning Work with Conditional Actions ActionScript includes the else statement you can use to create more sophisticated branching. An else statement lets you specify one set of actions to run if a condition is true, and an alternate set to run if the condition is false.

© 2011 Delmar Cengage Learning Work with Conditional Actions If a condition has more than two possible states, you can use the else if to set up a series of possible branches ActionScript using else if statements to create multiple branches

© 2011 Delmar Cengage Learning Work with Conditional Actions You may not want passwords to be visible onscreen as users enter them. Instead you can set an input text field to display asterisks rather than the actual keystrokes being typed by the user. You can generate x and y Stage coordinate values for an object’s position using the Math.random function.

© 2011 Delmar Cengage Learning Use ActionScript to Create External Links Many websites contain links to other sites and you might want to create links to lead the user to a related site or just to another site you want to share. The URLRequest class along with the navigateToUL function lets you open another file or jump from a button or a movie clip symbol to another website.

© 2011 Delmar Cengage Learning ActionScript to display a website Use ActionScript to Create External Links

© 2011 Delmar Cengage Learning Use ActionScript to Create External Links When you use the URLRequest to lead to another website, you must supply the URL for the file. Make sure you include the entire URL, including the protocol prefix, for example, which is known as an absolute path.

© 2011 Delmar Cengage Learning Use ActionScript to Create External Links You can also use URLRequest to create an link from a button or a movie clip symbol. To create an link, you need to include mailto: and then the address in the URL field of the URLRequest statement. If you want to create an link from text, not a button or movie clip symbol, you can use the Properties panel.

© 2011 Delmar Cengage Learning New message window for a mailto:link Use ActionScript to Create External Links To: field filled in with the address you specify