HO-12: Using Components in Flash

Similar documents
HO-1: INTRODUCTION TO FIREWORKS

HO-FL1: INTRODUCTION TO FLASH

Creating Fill-able Forms using Acrobat 7.0: Part 1

COMP : Practical 6 Buttons and First Script Instructions

Grade: 7 Lesson name: Creating a School News Letter Microsoft Word 2007

Adobe Flash CS3 Reference Flash CS3 Application Window

General Directions for Creating a Program with Flash

A Dreamweaver Tutorial. Contents Page

Creating Forms. Starting the Page. another way of applying a template to a page.

Adobe Dreamweaver CS5 Tutorial

How to lay out a web page with CSS

Flash basics for mathematics applets Tutorial 2. Reading input text boxes and writing to dynamic text boxes

1. Multimedia authoring is the process of creating a multimedia production:

ThumbnailList Component

Function Grapher Demystified Step 1

Paragraph Formatting. Set line and paragraph spacing and indentation Create a numbered or bulleted list

How to lay out a web page with CSS

Paragraph Formatting 4

AO3. 1. Load Flash. 2. Under Create New click on Flash document a blank screen should appear:

IT82: Multimedia Macromedia Director Practical 1

Widget Toolkits CS MVC

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

The Newsletter will contain a Title for the newsletter, a regular border, columns, Page numbers, Header and Footer and two images.

Adobe Flash CS4 Part 2: Working with Symbols

Adobe Flash Professional CS5.5

Creating 3D Text with LibreOffice

Building your own Flash MX Components Phillip Kerman

ADOBE DREAMWEAVER CS4 BASICS

Adobe Dreamweaver CC 17 Tutorial

How to resize content for multiple screens

Widget. Widget is a generic name for parts of an interface that have their own behaviour. e.g., buttons, progress bars, sliders, drop-down

GIMP TEXT EFFECTS. Text Effects: Outline Completed Project

Creating a 3D bottle with a label in Adobe Illustrator CS6.

6.3. Applying Designs CHAPTER

Function Grapher Demystified Step 2

MICROSOFT WORD 2010 Quick Reference Guide

Electronic Portfolios in the Classroom

Flash Image Enhancer Manual DMXzone.com Flash Image Enhancer Manual

Charting Progress with a Spreadsheet

SoftChalk. Level 2. University Information Technology Services. SoftChalk Level 2 Page 1 of 34

Teach Yourself Microsoft PowerPoint Topic 4: Slide Master, Comments and Save Options

Clip Art and Graphics. Inserting Clip Art. Inserting Other Graphics. Creating Your Own Shapes. Formatting the Shape

Setup Examples. RTPView Project Program

Access Made Easy. Form Controls.

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

Microsoft Visio 2010

Doing a flash animation for animb

Open a new Excel workbook and look for the Standard Toolbar.

Forms/Distribution Acrobat X Professional. Using the Forms Wizard

Overview of the Adobe Dreamweaver CS5 workspace

Word Processing Basics Using Microsoft Word

Paragraph Formatting 4

Interactive Tourist Map

Microsoft Excel Level 2

Responding to Events. In this chapter, you ll learn how to write code that executes in response. Understanding Event Types 65

MS Office Word Tabs & Tables Manual. Catraining.co.uk Tel:

Word Long Docs Quick Reference (Windows PC)

Adobe Acrobat 8 Professional Forms

and 150 in the height text box, and then click OK. Flash automatically inserts the px (for pixel) after the number.

chapter 1. Create symbols and instances 2. Work with Libraries 3. Create buttons 4. Assign actions to frames and buttons AND INTERACTIVITY

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Lesson 4. What You Will Learn. Approximate Time This lesson takes approximately 45 minutes to complete. Lesson Files

Remote Access Synchronization DL Parent

Typefi Publish 7 User Guide

Review Questions FL Chapter 3: Working With Symbols and Interactivity

B.Sc. VI SEM (CS+BIO)

SPARK. User Manual Ver ITLAQ Technologies

Lesson 4: Add ActionScript to Your Movie

Flash offers a way to simplify your work, using symbols. A symbol can be

Our Goals Teaching with Power Point

You can delete the default blank background by clicking on its Delete button.

FLASH ANIMATION TUTORIAL

Karlen Communications Importing/Exporting Styles in Word. Karen McCall, M.Ed.

Basic Concepts 1. Starting Powerpoint 2000 (Windows) For the Basics workshop, select Template. For this workshop, select Artsy

TECHNICAL TRAINING LAB INSTRUCTIONS

HAPPY HOLIDAYS PHOTO BORDER

Activate Course Import/Export/Copy Course Customization Create a Course Banner

DTP with MS Publisher

Blu Ray Burning in MZ280 Step 1 - Set Toast up to burn a Blu-ray Video Disc.

Introduction to CS Page layout and graphics. Jacek Wiślicki, Laurent Babout,

Valuable points from Lesson 6 Adobe Flash CS5 Professional Classroom in a Book

Page 1 of 4. Course Outline by Topic: Web Design Fall 2009 Instructor: Mr. O Connell Room 117

COMP : Practical 8 ActionScript II: The If statement and Variables

How to lay out a web page with CSS

CS 3 Midterm 1 Review

The new layer will be part of the template because we want it to appear alongside the nav bar on every page.

Page 1. Fireworks Exercise

HO-FL6: ADDING SOUND TO FLASH

How to create an animated face

Adobe Flash CS4 Part 4: Interactivity

DATA WAREHOUSE BASICS

1. Open NetBeans and click File... New Project... Select Java as the Category and Java Desktop Application as the Project Click Next.

Digital Media. Seasons Assignment. 1. Copy and open the file seasonsbegin.fla from the Read folder.

Microsoft Office Word 2010

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version):

Payment Function Exercise

WORD PROCESSING ASSIGNMENT # 1 ~ FILENAME: FONTS

Section 3 Formatting

Creating an expenses record spreadsheet in Excel

Skill Exam Objective Objective Number. Setting Page Layout Modify page setup

Transcription:

HO-12: Using Components in Flash Objectives To learn about using Flash s inbuilt components and explore how these can be used to increased user interactivity. To extend your understanding of programming in ActionScript 3.0. Flash Components Flash CS Professional comes with a number of pre-built components that fall into two main categories: (i) User Interface (UI) and (ii) Video components. You can access these by selecting Window/Components on the main menu (or Ctrl+F7). This reveals the components panel. The focus of this ho-exercise will be on the use of UI Components, such as buttons, checkboxes, radio buttons and combo boxes. These generally allow you to provide the user with options to select from. A component is a actually a movie clip with parameters that allow you to modify their appearance and behaviour, either at the authoring stage or at run time using ActionScript methods, properties and events. Components allow you to quickly build Flash applications which display consistent behaviour and appearance. They are designed to be reused, which means rather than creating new buttons, combo boxes and lists, etc you can use Flash components that implement these controls. To do this all you have to do is drag them from the Components panel into your Flash document. You can then customize the look and feel of the components to suit your application. You can read more about Components on the Adobe website: Flash CS4: http://help.adobe.com/en_us/actionscript/3.0_usingcomponentsas3/ Flash CS5: http://help.adobe.com/en_us/as3/components/index.html Buttons The first thing you are going to do is create a button using the button movie clip in Flash s Component Library. 1. Open Flash and create a new document called mpho12a.fla. 2. Modify the document so that it is 300 x 200 pixels in dimension and chose a suitable background colour. 3. Create two layers, one called Actions and the other Content. 4. Select frame 1 of the Content layer and use the Text Tool (on the Tools panel) to drag out a text field on the stage. In the Properties Panel choose Static Text from the pull down menu and enter a heading for this exercise, e.g. 'HO12A: A Flash Button from the Component Library. 5. With frame 1 of the Content layer still selected, drag a copy of the button from the Components panel onto the stage. HO-12: Using Components in Flash Page 1 of 7

6. Once the component is on stage its properties can be adjusted by using either: (i) the Properties and Parameters panel (select Window/Properties/Parameters to reveal the Property Inspector with the Parameters tab selected) or (ii) the Component Inspector panel (select Window/Component Inspector): 7. Use these to change the label text to: Continue and give the button an instance name: continue_mc. 8. Next draw out a Dynamic text box beneath the button, set the Properties to Single Line and give it an instance name: buttonclick_txt. 9. Save your movie and test it. What do you observe? At this stage not much as you now need to add the ActionScript code that will make something actually happen. 10. You should remember how to do this from the earlier handson exercises? If not it involves adding an event listener that responds to a mouse event (ie. The button being clicked), for example: continue_mc.addeventlistener(mouseevent.click, buttonclick); function buttonclick(event:mouseevent):void { buttonclick_txt.text = "Button Clicked" } 11. Add this ActionScript code to Frame 1 of the Actions layer and retest your movie. The dynamic text box should be populated when you click on your button. Radio Buttons This exercise uses a series of radio buttons to create a simple multiple choice type question (in this case 'What is the pass mark for an ITApps FMA?'). The user then has to select the radio button that they think corresponds to the correct answer: 1. Open Flash and create a new document called mpho12b.fla. 2. Modify the document so that it is 400 x 300 pixels in dimension and chose a suitable background colour. 3. Create two layers, one called Actions and the other Content. 4. Select frame 1 of the Content layer and use the Text Tool (on the Tools panel) to drag out a text field on the stage. In the Properties Panel choose Static Text from the pull down menu and enter a heading for this exercise, e.g. 'ITApps Assessment Quiz. Adjust the text properties, size, colour, etc as appropriate. 5. Create two more Static Text boxes with text, Question 1: What is the Pass Mark for an ITApps FMA? and Answer, positioned as shown below. 6. Next create a Dynamic Text box, with an instance name: answer_txt, set the properties so that a border will be shown around the text. HO-12: Using Components in Flash Page 2 of 7

7. Position the Dynamic Text box beside the Static Text box labelled: Answer (Note: you may need to re-position the Dynamic Text box when you come to test your movie to ensure the text in the two boxes is correctly aligned): 8. Finally select Window/Components on the main menu to reveal the Components library and drag four instances of the Radio Button from the Component Library onto the stage. 9. Position these Radio Buttons below the Question 1 text block (see figure below). 10. Select Window/Parameters to set the parameters of each of the radio buttons in turn, setting: groupname = q1group; label = 30%, 35%, 40%, 45%; instance name = rbutton1, rbutton2, etc; and value = 1, 2, 3 and 4, respectively. Finally set the selected value = true for rbutton1, but leave it false for the other 3 radio buttons: 11. Note: (a) You must assign all four buttons to the same groupname (q1group) to make them behave as a single unit. (b) The label field contains the text that will appear next to the radio button. (c) The labelplacement field controls the relative positioning of the label's text (in this example the text is right aligned. (d) The selected field indicates whether that radio button is selected (in this example this field is to false for all the radio buttons, so none are initially selected). HO-12: Using Components in Flash Page 3 of 7

(e) The value field contains the value that will be returned when that button is selected. Usually this is set to return simple numerical values, e.g. 1, 2, 3, 4 etc but it can be set to return a text string. 12. You now need to add a button that the user clicks to check whether they have got the correct answer. Rather than create a button from scratch simply drag a copy of the Button from the Component Library. 13. Position the button in between the Radio Buttons and the Answer text block (note you may need to reposition the latter to create enough space for the new button) and set the label to: Check Answer and instance name to: chkans: 14. Note: by double clicking on the button you reveal the different states of the button. You can then double click on the relevant state of the button to adjust its properties. 15. Save your work and test your movie. You should find: (i) that your Radio Buttons function correctly, i.e. only one can be selected at any one time!? And (ii) the button state changes when you roll over or click on the button (depending on how you adjusted the properties of the button). Other than that nothing else happens. 16. Your final task is to add ActionScript code (similar to that shown below) so that the quiz compares the users selection against the correct answer and returns a message depending on whether the user is correct or not: HO-12: Using Components in Flash Page 4 of 7

17. Once you have entered the code test you movie to see whether it functions correctly? If it does it should look similar to that show below: 18. Once all is working OK, resave your file. 19. Note: At present the answer that is returned in the dynamic text box is the same for each wrong answer. 20. Save a copy of your file as mpho12c.fla and think about how the ActionScript code can be modified to generate a different response based on which radio button is selected? For example, if: rbutton1 is selected; response = 'Incorrect, 30% is much too low. rbutton2 is selected; response = 'Incorrect, 35% was the old pass mark.' rbutton4 is selected; response = 'Incorrect, 45% is much too high.' 21. Essentially you need to modify the if statement in your function: HO-12: Using Components in Flash Page 5 of 7

CheckBoxes This exercise uses a checkbox to perform one of two actions depending on whether the checkbox is selected or not. 1. Open Flash and create a new document called mpho12d.fla. 2. Modify the document so that it is 400 x 200 pixels in dimension and chose a suitable background colour. 3. Create two layers, one called Actions and the other Content. 4. Select frame 1 of the content layer and drag a copy of the CheckBox out of the Component library onto the stage. 5. Select Window/Properties/Parameters to adjust its properties, setting instance name = protectch, and the Label = Click if Loan Protection is Required: 6. With frame 1 of the Content layer still selected use the Text Tool to drag out two Dynamic Text boxes on the stage: Position one of the Dynamic Text box immediately below the checkbox and set its properties to, instance name: protect, Font: Arial, 10pt, Red. Position the other Dynamic Text box toward the bottom right of the stage and set its properties to, instance name: protectpay, Font: Arial, 14pt, Black. 7. Finally insert a Static Text beside the 2 nd Dynamic text box and enter the following text label: Payment Protection: 8. Resave your work and test your movie. Again very little will happen because you still have to add the ActionScript code. 9. Thinking about what you have done earlier in this exercise, try and write code that will return the following text: (I) 'Payment Protection is Required' in the top Dynamic Text, and (ii) the amount of the payment protection (= 5000 x 0.03) in the bottom Dynamic Text Box, when the user clicks on the CheckBox. HO-12: Using Components in Flash Page 6 of 7

10. Your ActionScript code should look similar to that shown below: 11. The final movie should look similar to that shown below: 12. Click here to download all the completed Flash files from the exercise. Additional Reading and Resources: Getting Started with Flash Interface Components: http://www.adobe.com/devnet/flash/quickstart/getting_started_ui_components.html Components Learning Guide for Flash: http://www.adobe.com/devnet/flash/learning_guide/components.html Flash Components: http://www.adobe.com/devnet/flash/components.html Flash Components: http://oreilly.com/flash/excerpts/flash-learning-cs4/components.html Learn How-to Create Flash Components using AS3, XML and Flickr API: http://www.thetechlabs.com/tech-tutorials/xml/learn-how-to-create-flash-componentsusing-actionscript-30-xml-and-flickr-api/ An XML-based Radio Button Quiz in Flash CS3: http://www.flashandmath.com/intermediate/radiobuttonquiz/index.html Creating e-learning content: http://livedocs.adobe.com/flash/9.0/usingflash/ HO-12: Using Components in Flash Page 7 of 7