Macromedia Flash MX A Brief Tutorial for “Programming Usable Interfaces” Andrew Ko.

Slides:



Advertisements
Similar presentations
Distributed Multimedia Programming Week - 1. Document Window The Document Window is divided in to six main components Timeline – The Timeline is where.
Advertisements

1What is the Stage. 2How do you open a panel in Flash
“Computers and Creativity”
Foundation Level Course
 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.
Adding Interactivity to Flash Movies Using Buttons and ActionScript SPACE Lab
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
© Anselm Spoerri Lecture 10 Flash –Recap –Key Components & Tools –Animating Bitmaps –How to modify Color and Transparency of Bitmap –Animating along Motion.
Macromedia Flash 5 Intermediate Level Course. Animation Basics Playhead In-Between Frames Keyframe Current Frame Number Framerate Current Time Frames.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
Creating Animation Pertemuan Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
© 2010 Delmar, Cengage Learning Chapter 4: Creating Animation.
Chapter 3 Working with Symbols and Interactivity.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
BUILDING RICH MEDIA ELEMENTS. Design Decisions Based on Design Specification  Following the design specification will ensure that the application is.
Introduction to Flash FYS100 Creative Discovery in Digital Art Forms Spring 2007 Burg.
1 Flash Basics by Dr SC Li. 2 File Types  In general, Flash 5.0 generates 3 types of files:  ???.fla  Flash ’ s working file  ???.swf  Flash movie.
CIS 205—Web Design & Development Flash Chapter 1 Getting Started with Adobe Flash CS3.
Flash MX II. Flash MX – Tweened Animation There are two methods for creating an animation sequence in Flash –Frame-by-frame animation –Tweened animation.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Button library Create a button Learn.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Buttons library Edit a button instance.
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.
1-1 OBJ Copyright 2003, Paradigm Publishing Inc. Dr. Joseph Otto Silvia Castaneda Christopher deCastro CSULA Macromedia Flash MX Introduction.
© 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.
UNDERSTANDING ADOBE FLASH. The Flash Interface  The flash interface provides you with:  A menu bar  Panels  A work area: stage.
Working with Symbols and Interactivity
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Tutorial 1 Introducing Adobe Flash CS3 Professional
CSC 361/661 Digital Media Spring 2010 Professor Burg.
XP Tutorial 4 Special Animations. XP New Perspectives on Macromedia Flash MX Special Layers for Animation Animation Using a Motion Guide Layer.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Adobe Flash CS3 Revealed
Flash! Macromedia Flash is the key to designing and delivering low-bandwidth animations, presentations, and Web sites. It offers scripting capabilities.
© 2011 Delmar, Cengage Learning Chapter 4 Creating Animations.
Chapter 4 Creating Animations. Chapter 4 Lessons 1.Create motion tween animations 2.Create classic tween animations 3.Create frame-by-frame animations.
Week 11 Hands on Flash Pelekanou Olga INF221 INTRODUCTION TO MULTIMEDIA.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
Flash CS 5 Interface BY NSCHEWCZYK | ©2012. MENU BAR A bar at the top of the window. It lists menu options including: File, Edit, View, Insert, Modify,
Distributed Multimedia Programming Week – 4A Buttons Movie Clips.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Introduction to Flash CSC361/661 Digital Media Spring 2007 Burg.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Macromedia Flash Design Professional And Interactivity WORKING WITH SYMBOLS.
1 Flash Basics by Dr SC Li. 2 Ordinary Movie vs. Flash Movie AnimationVector GraphicsInteractivity MPEG MovieFlash Movie.
Tutorial 3 Creating Animations. XP Objectives Learn the different elements of animation Create frames and layers Organize frames and layers using the.
Flash Develop Rich Internet Content and Applications –Design motion graphics or build data-driven applications Flash Document = “.fla” filename extension.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
FLASH!!!!!!!!!!!!!!!!!!!!!!!!! A TUTORIAL BY BRITTANY HESS AND MARGARET DENTON.
CIS 205—Web Design & Development Flash Chapter 3 Appendix on Using Buttons.
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.
Flash Concepts and Demos - Overview Recap Unit 2 –Buttons (Simple Text and Animated Button) –Gradient Tool –ActionScript (stop, getURL) –Embed Flash Movie.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Flash 1. Document Properties Set frame rate and dimensions of project Set frame rate and dimensions of project (default width=550 and height=400)
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Macromedia Flash MX Design Professional And Interactivity WORKING WITH SYMBOLS.
Adding Buttons, Actions, and Sounds
Flash Interface, Commands and Functions
Chapter Lessons Use the Macromedia Flash drawing tools
Animate Some more advanced concepts
Working with Symbols and Interactivity
Develop Rich Internet Content and Applications
Flash Concepts and Demos - Overview
Presentation transcript:

Macromedia Flash MX A Brief Tutorial for “Programming Usable Interfaces” Andrew Ko

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Versions Macromedia Flash MX Not Flash MX 2004 (the newer version) Not any older version No site license PC version: Wean clusters, Cyert Hall Mac version: Hunt Library, Cyert Hall

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons A Beginner’s Book Foundation Macromedia Flash MX Kris Besley Comes highly recommended on Amazon ~$10 paperback on Amazon and Half.com Not a reference, but a very detailed introduction for people unfamiliar with Flash

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons VB.NET vs. Flash MX VB is great for form-based applications Flash is great for time-based applications Both VB and Flash are event-based.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

What is Flash? Timeline Drawing Vector Graphics Stage ActionScript And lots and lots of terminology... Palettes

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Stage Contains the objects, images, drawings, buttons, etc. Where drawings are created, modified, deleted, etc. Things can go outside the stage, but they are clipped when the movie is played.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Stage Modify the stage size, background color, frames per second, ruler units, etc. by going to: Modify ➔ Document...

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Stage Use the hand tool to move around the stage without using the scroll bars Use the magnifying glass to zoom in and out. Select an area to zoom into by dragging a rectangle Hand and Magnifying Glass

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Vector Graphics All shapes in Flash are made out of points, lines, and curves. Even this one:

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Vector Graphics Because shapes are made out of points, Flash Snaps objects’ edges together Snaps objects’ points to each other All shapes have an outline and fill color, a line pattern, and a stroke thickness These can be changed in the property window

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Freeform Lines and Shapes Pencil Your freeform stroke is turned into a modifiable shape. Options that allow you to straighten, smooth, or “ink” (no modification)

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Lines, Ovals, and Rectangles Line For rectangles, the “radius” of the corner Ovals and rectangles Options

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Paths of Lines and Curves Pen Click once to make a straight line in the path. Click and drag to make a curve. Click on a previously made point to close the shape. Pay close attention to the changes in the cursor with this tool.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Brush Strokes Brush Like brushes in other applications, has a radius and shape. The options also allow for filling behind, selection, inside...

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Erasing Parts of Shapes Eraser Like erasers in other applications, has a radius and shape. The options also allow for erasing fills, lines, and other things.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Timeline A view of all of the frames and layers in your movie Of course, most Flash-based media is interactive, so its not exactly a movie.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Frames This is a frame Frame 1 is currently selected This movie shows 12 frames per second

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Frames Use the insert menu to insert and remove frames. We’ll insert 11 frames

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Frames The black dot means that frame 1 is a keyframe The grey frames 2-12 have the same content as the frame 1, the keyframe The hollow white rectangle means that it is the end of the span of frames. A keyframes defines the content of all frames following it, up until the next keyframe.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Frames Frame 1, a keyframe, has a black oval on the stage. All of the grey frames following it have the same black oval as frame 1. The last frame that with the black oval is frame 12, represented by the white rectangle. This movie will show this black oval for 12 frames (1 second) and then loop.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

Frames If we want to change what the 13th frame displays, we “insert a keyframe” This copies the previous keyframe’s contents. We can then change the contents of the new keyframe. Inserting actually just changes the selected frame to a keyframe.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Frames Now, the first 12 frames have a black oval. The 13th frame has a red oval of the same size.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

Layers Just like Illustrator and other applications, Flash supports layers of content. The layers are part of the timeline. Layers can be locked, hidden, and organized in folders. Layers determine the order in which content is displayed for each frame.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Layers Here I’ve renamed Layer 1 to Nose and added a layer called Face Then I drew a brown rectangle on the Face layer.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Layers Then I added an Eyes layer, and drew the eyes and mouth. Then I drew a the eyes and the mouth

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

Symbols Symbols are tricky. Symbols can also be thought of as a class. A single Button class ➔ many Button instances Symbols = Separate Timeline + Stage + Layers So they can also be thought of as movies inside of movies.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Instances of Symbols What do you do with symbols? You make instances of them (like you make an instance of a class) All instances of a symbol share the same properties, animations, code, etc., but can be in different places and times on the timeline.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Types of Symbols Graphic Operate in sync with the main movie’s timeline. Used for images or reusable animations. Movie Clip Movie inside a movie. On their own time, not necessarily in sync with the main timeline. Good for interactive things and sounds.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Types of Symbols Buttons Special kind of Movie Clip symbol that responds to clicks, rollovers and other actions. You define the graphics for each of the various button states, and then assign particular actions to an instance of a button.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Making a Symbol You can make a new, blank symbol by going to Insert→Insert Symbol... Here, we have selected the eye (by locking the nose and face layers and dragging a box around the eye), so the menu says Convert to Symbol instead.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Library Now, the eye appears in the Library as a new symbol. The library contains all of this Flash document’s symbols.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons An Instance of a Symbol Now, the left eye is an instance of the AnimatedEye symbol After erasing the right eye, we can drag a new instance of the AnimatedEye symbol from the library for the right eye. Now we have two instances of the animated eye symbol, each with their own positions, but sharing the symbol’s timeline, layers, etc.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Naming Instances Its important to name an instance if you want to refer to it in code. We name the left eye leftEye by selecting the left eye and changing the instance name in the property window. We do the same for the right eye.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Editing a Symbol To edit a symbol, double- click on the symbol in the library (either the name or image). Our view is now inside the main scene. You can return to it by clicking here. Notice that the timeline, layers, and stage are now specific to the AnimatedEye symbol.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Editing a Symbol We’ll make the eyes look at the mouse cursor. First, let’s move the pupil to the right. That way, when the rotation of the symbol is 0, the pupil is at 0 degrees.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Editing a Symbol Let’s make the eyes blink every 1/12th of a second. If we right-click on the 12th frame in the eye’s timeline and select insert frame, it inserts frames in between. Then we make a keyframe, and change the eye so that it is blinking.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

ActionScript Let’s make the eyes look at the mouse using ActionScript, the Flash scripting language. ActionScript is event-based, like VB.NET, and has two main types of events: Button events (pressed, released, rollOver...) MovieClip events (load, enterFrame, mouseMove...) Each has its own syntax.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons ActionScript ActionScript code is associated with frames, Movie Clips, and Buttons. Just before a frame is displayed, its code is executed. The frames following a keyframe share the same code as the keyframe. The keyframe’s code is executed just before it is displayed.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Action Window There are two editing modes In expert mode, you type, and can use the Intellisense like pop-up to see the available methods. In normal mode, you drag and drop “Actions” from the area in the left.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Action Window The code shown in the Actions window depends on the current selection in the Flash environment. Individual frames can have ActionScript. This is represented by the ‘a’ in the frame. All frames that follow a keyframe share the same ActionScript code. To help you find your code, make a layer in the timeline that is reserved for code only. Then you only have to search in that one layer.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons The Action Window Movie clips can also have code, but it can only be movie clip event handlers. Notice that the movie clip’s code appears when the movie clip is selected. The code shown in the Actions window depends on the current selection in the Flash environment.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Following the Mouse To make the eyes follow the mouse cursor, we will put event handling code “in” each eye. The Actions window for the left eye instance doesn’t have any code yet.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Following the Mouse This event handler will be called when the mouse moves.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Following the Mouse These two lines define two variables xDelta and yDelta. _root._xmouse refers to the current x position of the mouse, based on the main stage’s coordinate system. _x and _y refer to the x and y position of the left eye, based on the main stage’s coordinate system.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Following the Mouse This defines degrees. atan2() takes the x and y deltas and returns the degrees in radians. This math converts the radians to degrees.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Following the Mouse This sets the rotation of the left eye to the value of degrees. This -5 corrects for my sloppy drawing.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

We’ll edit the symbol by double-clicking on it in the library... Go to the blink frame of the eye animation... Open the Action window for the frame......and set the rotation of the eye to 0 for that frame.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

Create a “blinking” variable that’s true when Rudolph is blinking.... Then remember the old rotation so we can restore it after blinking.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons In the first frame, we’ll restore the old rotation value.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Then, we’ll avoid rotating the eye if its in the middle of blinking.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Finally, we’ll copy the code from the left eye to the right eye.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons

Buttons Buttons are a special type of Symbol, which have frames for each of their states. Let’s make Rudolph’s nose a button by converting it to a symbol.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Buttons A Button has four frames, each defining its appearance and behavior in different states. Up is when the button is not pressed, or released. Over is when the button is hovered over. Down is when the button is pressed. Hit defines the clickable area of the button.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Up The nose’s up frame will be just as it is.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Over To make the nose’s over frame, insert a keyframe. I’ve filled the nose with brown. If we don’t make a keyframe, this changes the up frame to brown as well.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Down To make the nose’s down frame, insert a keyframe. I’ve filled the nose with red.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Hit By default, the clickable area is defined by the oval on the screen.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Button Events To make an event for the button, select the NoseButton instance on the stage, and open the Actions window. Use on(event) to respond to press, release, rollOver, etc.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Button Events When pressed, the eyes will goto frame 12 (the blinking frame) and stop playing. When the nose button is released, the eyes will go to frame 1 and start playing.

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Button Events

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons We’ll remove the keyframe with the red nose, so the nose button is clickable for the whole movie. Button Events

Intro The Stage Vector Graphics Timelines Layers Symbols ActionScript Buttons Button Events