1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.

Slides:



Advertisements
Similar presentations
1What is the Stage. 2How do you open a panel in Flash
Advertisements

© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
 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.
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.
Flash Workshop Flash Workshop :: Agenda  Introductions  Look at a few Flash Examples  Flash Web Sites  Flash Web Applications  Flash Games.
© Anselm Spoerri Lecture 11 Flash –Build Flash Website with Animated Navigation Structure –Decide on Overall Navigation Layout, Import Images & Organize.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Chapter 3 Working with Symbols and Interactivity.
Chapter 15 Video. Importing Video Into Flash Once you import video into Flash MX 2004, you can control it using behaviors and very basic ActionScript,
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
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.
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.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
Adobe Flash CS5.5. What is Adobe Flash? formerly Macromedia Flash Is software is a powerful authoring environment for creating animation and multimedia.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
© 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.
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.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
CSC 361/661 Digital Media Spring 2010 Professor Burg.
Chapter 16 Video. Importing Video Into Flash  Once you import video into Flash, you can control it using behaviors and very basic ActionScript, target.
Week 11 Hands on Flash Pelekanou Olga INF221 INTRODUCTION TO MULTIMEDIA.
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.
5-1 OBJ Copyright 2003, Paradigm Publishing Inc. Adding Sound, Video, and Basic Interactivity with Buttons Macromedia Flash Design & Application.
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,
XP Tutorial 8 Adding Interactivity with ActionScript.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
WORKING WITH SOUND & VIDEO CHAPTER 7 PART I. USING SOUNDS Mp3 & WAV files Drag the sound files from the Library panel onto Stage at different points along.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Tutorial 3 Creating Animations. XP Objectives Learn the different elements of animation Create frames and layers Organize frames and layers using the.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
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.
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 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
XP Tutorial 8 Adding Interactivity with ActionScript.
PowerPoint Basics Tutorial 2: A Slide Show In this tutorial you’re going to create a presentation from scratch. You will have to keep this presentation.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Macromedia Flash MX Design Professional And Interactivity WORKING WITH SYMBOLS.
 Movieclip symbols are reusable pieces of flash animation  consisting usually of one or more graphic/button symbols  thus they are flash movies within.
 Motion Tween allow us to move a shape on the stage from one place to another.  In order to use motion tween, the shape to be moved must be converted.
Packages that we use Within ICT we primarily use Dreamweaver CS3 and Flash CS3 This is embedded in an Adobe Design Premium CS3 package (Go to Start >
Tutorial 3 Creating Animations.
Adding Buttons, Actions, and Sounds
Unit Lessons Work with actions
Interface Programming 2 Week 1
Chapter Lessons Create shape-tweened animations Create a mask effect
Working with Symbols and Interactivity
Flash Demonstration – Unit 5 – ActionScript 3.0
Exercise : Animated Navigation Structure in Animate (= Flash)
Exercise : Animated Navigation Structure in Flash
Presentation transcript:

1 Flash Programming Introduction Script Assist

2 Course Description This course concentrates on the teaching of Actionscript, the programming language used primarily for the development of websites and software using the Adobe Flash Player platform. Lecturer: Nina Bresnihan Room 3.4, 8 Wsq Nina.

3 Course Aim & Learning Outcome Students will be introduced to the fundamentals of Actionscript programming. They will become familiar with its structure and syntax and how it interfaces with the Flash software.

4 Topics Covered 1. Script Assist 2. Variables 3. Objects Properties Methods Events and Event handling 4. Control Structures Sequence Selection Iteration

5 Topics Covered 6. Arrays 7. Animation 8. Organising your Code 9. Writing Class Files 10. Working with MovieClips Controlling Playback Creating Dynamically 11. Flash and the Web

6 What is Actionscript? ActionScript lets you add interactivity to a movie. ActionScript provides elements, such as actions, operators, and objects, that you put together in scripts that tell your movie what to do; You set up your movie so that events, such as button clicks and key presses, trigger these scripts. E.g., you can use ActionScript to create navigation buttons for your movie.

7 Writing ActionScript with Script Assist For users who are new to ActionScript, or for those who want to add simple interactivity without having to learn the ActionScript language and its syntax, you can opt to use Script Assist to help you more easily add ActionScript to your Flash documents.

8 About Script Assist Script Assist lets you build scripts by selecting items from the Actions toolbox, the list on the left side of the Actions panel. When you click an item once, its description appears at the upper right of the panel. When you double-click an item, it adds the item to the Actions panel Script pane.

9 About Script Assist You can add, delete, or change the order of statements in the Script pane; You can enter parameters for actions in text boxes above the Script pane. Script Assist also lets you find and replace text, and view script line numbers.

10 Using Script Assist to Add Interactivity To follow along with this lab, you will need the following file: Sample file (ZIP, 0.3 MB)

11 Using Script Assist to Add Interactivity 1. In Flash, choose File > Open and open the scriptAssist.fla file. Select the content layer in the Timeline. This layer contains a movie clip with the instance name Bottle. 2. Click the padlock icon at the top of the Timeline to unlock all of the layers. 3. Double-click the Stage to open the movie clip in document-editing mode.

12 Using Script Assist to Add Interactivity 4. Notice the Timeline contains an FLV file, or Flash video file, that's been imported into the movie clip. Click and drag the playhead over the Timeline to preview the video.

13 Using Script Assist to Add Interactivity 5. Click the Scene 1 link in the edit bar to return to the main Stage. 6. Choose Control > Test Movie or press Ctrl/Cmd and Enter to export a test version of the movie. 7. Notice the animation begins as soon as the movie starts. You'll add a button the user has to click to see the animation. 8. Close the Movie window.

14 Using Script Assist to Add Interactivity 9. Choose Window > Library to open the Library panel. A simple button has already been created, called startButton. 10. Drag an instance of the symbol onto the Stage, and position it in the bottom right corner. Now you need to give the button an instance name so that it can be called out in ActionScript.

15 Using Script Assist to Add Interactivity 11. Choose the Property inspector and type startButton for the Instance Name. You're ready to write the ActionScript. Don't worry; you're not actually going to be writing code. That's where the Script Assist feature comes in… 12. Go to the Timeline and lock the Content layer. Select the first keyframe in the Actions layer. 13. Choose Window > Actions to open the Actions panel

16 Using Script Assist to Add Interactivity

17 Using Script Assist to Add Interactivity 14. Examine the Actions panel. The left pane is referred to as the Actions toolbox, and contains all the class libraries. You navigate through each library to access the individual classes, and their associated methods and properties. You can add them to your ActionScript by dragging them into the code pane. The Actions toolbox is designed to work with the Script Assist feature. You'll use these two features together to build the ActionScript for this movie.

18 Using Script Assist to Add Interactivity 15. Click the Script Assist button. The first thing you want to add is code to stop the animation the movie clip named Bottle from playing automatically when the movie starts. Knowing that the animation is a movie clip is important when you're determining and finding the class in the Actions toolbox. Script Assist assumes some basic knowledge of ActionScript for you to be able to create these scripts. In this case, you need to know that movie clips reside in the flash.display package.

19 Using Script Assist to Add Interactivity 16. Double-click flash.display to open this library. 17. In the Actions toolbox, navigate down to Movie Clip/Methods. Several methods are listed, including a method called stop. 18. Double-click stop to insert the stop command into the panel. It includes the phrase " not_yet_set " to indicate that you have not yet supplied the command a reference to a movie clip.

20 Using Script Assist to Add Interactivity Meanwhile, an input field opens in the Script Assist pane, labelled Object. Remember, the movie clip you want to stop is called Bottle.

21 Using Script Assist to Add Interactivity 19. For Object, type bottle. You've just written your first piece of ActionScript code. The next thing you need to do is set the Mouse Down event for the button, a transition event that calls another line of code when the button is clicked. Once that event is triggered, the movie will start. To set mouse events in ActionScript 3.0, you must use the event listener method.

22 Using Script Assist to Add Interactivity 20. Find this method in the flash.events package, under the IEventDispatcher class. Navigate down to the Methods list and double- click addEventListener. The addEventListener is automatically added to the Actions panel. Several different input fields open in the Script Assist pane to let you set up the addEventListener method.

23 Using Script Assist to Add Interactivity

24 Using Script Assist to Add Interactivity 21. For Object, type startButton. This is the object that listens for the Mouse Down event. Next, you'll specify the kind of event that the listener listens for using the Type input field. 22. To find a mouse event, go to the Actions toolbox and navigate down to flash.events > Mouse Events > Properties.

25 Using Script Assist to Add Interactivity 23. Select the Actions panel to re-open Script Assist, and insert your pointer in the Type text box. Double-click MOUSE_DOWN to select it and add the necessary code to the Actions panel. The next input field for the addEventListener is listener. This is the function you want the listener to call when triggered.

26 Using Script Assist to Add Interactivity 24. Type startClip. You'll create a function under this name in the next few steps. 25. Notice the brackets around the field names, indicating that the rest of the parameters in the Script Assist pane are optional. Now it's time to create the startClip function.

27 Using Script Assist to Add Interactivity 26. Go to the Actions toolbox and navigate down to Language Elements > Statements, Keywords and Directives > Definition Keyword. Double-click function to insert the code in the Actions panel. This opens a new set of input fields in the Script Assist pane.

28 Using Script Assist to Add Interactivity

29 Using Script Assist to Add Interactivity 27. For Name, type startClip. This is the function name you listed in the event listener. When you use the addEventListener with mouse events, it sends an event object to the function. You need to add this event object to the parameters for the function. 28. For Paramerters, type e:MouseEvent. 29. Now you need to add the code to start the bottle movie playing.

30 Using Script Assist to Add Interactivity 30. Click the Script Assist button again to return to the regular editing mode.Insert your cursor on Line 4 before the closing function brackets- }. 31. Go to the Actions toolbox and choose flash.display > MovieClip > Methods. Double-click play to insert the code in the Actions panel. 32. Replace not_yet_set with bottle. Insert a semi- colon after the closing parentheses - ). You have finished the code.

31 Using Script Assist to Add Interactivity

32 Using Script Assist to Add Interactivity To recap, the first piece of your code stops the movie from playing automatically. The second creates the mouse down event for the start button, which, when triggered, calls the next piece, the startClip function which plays the movie clip. 33. Choose Control > Test Movie to check your work. Script Assist is really helpful when you're familiar with object names and classes, but you are not so sure about the syntax and required parameters for methods and classes.