SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Advanced ActionScript Concepts
    IT 7220

    February 23, 2009


Sunday, February 22, 2009            1
Agenda

         Syllabus Updates
    ✤




         Game Assessment Papers
    ✤




         Rosenzweig - ActionScript 3.0/Game Programming University
    ✤




         Building Game Elements in ActionScript 3.0
    ✤




         HOT Lab - Flash Components and Forms
    ✤




         Work in Project Teams
    ✤




Sunday, February 22, 2009                                            2
Rosenzweig GP University

         Flash Game University (http://flashgameu.com/)
    ✤




               Companion Website to Book
          ✤




               Source code for all games referenced in text
          ✤




               Video tutorials
          ✤




               Blog
          ✤




               Forums
          ✤




Sunday, February 22, 2009                                     3
Rosenzweig Chap 1 Overview

         Review of Flash Interface
    ✤




         ActionScript in timeline and using document class files
    ✤




         Condition statements
    ✤




         Loops - For, While, Do
    ✤




         Use of Flash ActionScript Debugger
    ✤




         Game Programming Checklist
    ✤




Sunday, February 22, 2009                                         4
Simple ActionScript Program

         HelloWorld1.fla
    ✤




               ActionScript in timeline, output using Trace Function
          ✤




Sunday, February 22, 2009                                              5
Placing Objects on Stage

         HelloWorld2.fla
    ✤


               Still working with
          ✤

               ActionScript in the Timeline
               Create text field object
          ✤


               Assign a value to it
          ✤


               Place on stage (in display list)
          ✤


               No text parameters for control
          ✤
                                                            Stage
               over placement or appearance       (Display Object Container)


               of object
                                                      Main Timeline
                                                  (Display Object Container)




                                                         TextField
                                                      (Display Object)




Sunday, February 22, 2009                                                      6
Document Class Library

         HelloWorld3.as
    ✤


               All document classes are
          ✤

               derived from either the
               MovieClip or Sprite class
               MovieClip class is a container
          ✤

               class which includes the
               stage and timeline with each
               instance created
               This allows the text object to
          ✤

               be added to the movie clip
               Document class must then be
          ✤

               added to the Flash project file
               using the properties panel

Sunday, February 22, 2009                       7
Rosenzweig Chap 2 Overview

         Creating and working with visual objects
    ✤




         Player input
    ✤




         Controlling animation with ActionScript
    ✤




         Player Interaction via the Keyboard
    ✤




         Accessing external data
    ✤




         Arrays
    ✤




Sunday, February 22, 2009                           8
Visual Objects - Movie Clips

         We can add movie clips to our project by dragging them from the
    ✤

         library to the stage, and then adjusting appearance using the
         properties panel

         It is also possible to add movie clips from the library solely with
    ✤

         ActionScript, by setting the symbol linkage properties

         Lets take a look at the mascot movie clip in UsingMovieClips.fla
    ✤




         The MC timeline has four layers to make it easier to change the
    ✤

         animation a single part of the movie


Sunday, February 22, 2009                                                      9
Create MC Objects - Flash Interface



         Drag as many instances of a movie clip symbol onto the stage as you
    ✤

         want

         Position using select tool/properties
    ✤




         Scale and rotate using free transform tool
    ✤




Sunday, February 22, 2009                                                      10
Create MC Objects - ActionScript


         First, we make the movie clip accessible to ActionScript by setting the
    ✤

         Linkage properties (see Fig 2.2, p 43): enter Class name and select
         Export for ActionScript

         Next we use ActionScript to create a single instance on the stage at
    ✤

         x=275, y=150, and rotating the movie clip 10º to the right

         Finally, using a For loop, we create 10 additional instances of the
    ✤

         movie clip at y=300, spaced 150 pixels apart from each other, scaled at
         50% of the size of the symbol class



Sunday, February 22, 2009                                                          11
Button Creation in ActionScript


         Buttons can be made from either movie clips or button symbols stored
    ✤

         in the library

         As we have seen, an event listener:
    ✤

                     objectName.addEventListener(MouseEvent.CLICK, objectFunction);
         is then used to link a button to an action

         Lets take a look at MakingButtons.fla
    ✤




Sunday, February 22, 2009                                                             12
Simple Shapes in ActionScript


         It is possible to create simple
    ✤

         graphics entirely within
         ActionScript such as lines,
         rectangles, circles, and ellipses

         Closed shapes can also be filled
    ✤

         in

         Lets take a look at
    ✤

         DrawingShapes.fla



Sunday, February 22, 2009                    13
Using Sprites in ActionScript

         The Sprite class is a basic display list building block: a display list
    ✤

         node that can display graphics and can also contain children.

         A Sprite object is similar to a movie clip, but does not have a timeline.
    ✤

         Sprite is an appropriate base class for objects that do not require
         timelines. For example, Sprite would be a logical base class for user
         interface (UI) components that typically do not use the timeline.

         The Sprite class is new in ActionScript 3.0.
    ✤




         Lets take a look at CreatingSpriteGroups.fla
    ✤




Sunday, February 22, 2009                                                            14
Managing the Display List


         As we add objects to the display list, the last object added appears in
    ✤

         front of previously added objects

         We manage the position of “children” on the stage using
    ✤

         setChildIndex (first position is 0)

         Lets take a look at SettingSpriteDepth.fla
    ✤




Sunday, February 22, 2009                                                          15
User Input in ActionScript

         Mouse Input
    ✤


               Use event listener to track mouse movement and rollover
          ✤

               MouseInput.fla
         Keyboard Input
    ✤


               Use event listeners to detect key press (requires ASCII codes)
          ✤

               KeyboardInput.fla
         Text Input
    ✤


               Using AS to set input type, properties and actions
          ✤

               TextInput.fla


Sunday, February 22, 2009                                                       16
User Interaction in ActionScript


         Many games allow interaction with an object using the arrow keys
    ✤

         MovingSprites.fla

         Another common method of interaction is dragging an object using
    ✤

         the mouse. The example creates an instance of the Point() class to
         track movement.
         DraggingSprites.fla




Sunday, February 22, 2009                                                     17
Rosenzweig - Wrap-up

         Chapter 2 covers a lot things you can do with ActionScript for
    ✤

         creating games

         Be sure to review the additional sections:
    ✤




               Random numbers and Shuffling an Array
          ✤




               Accessing external data
          ✤




               Collision detection
          ✤




               Animation examples
          ✤




Sunday, February 22, 2009                                                 18
HOT - Components and Forms

         You can create a form in html that includes text entry fields, check
    ✤

         boxes, radio button, combo boxes, lists, etc. You can also set the tab
         order for the form elements to aid in usability. The contents of the
         form may then be submitted using either a form post method or by
         calling a script.

         Submitting form contents is generally via server-side script to tell
    ✤

         what to do with the form contents. Scripts may be in JavaScript, Perl,
         ASP.NET, Visual Basic, or other scripting languages.

         Flash allows the creation of Forms, creating rich-content user
    ✤

         applications using a set of pre-defined component classes which may
         be instantiated using the stage or through ActionScript.

Sunday, February 22, 2009                                                         19
HOT - Working with Components


         Chap 15 builds a form in Flash using the Flash UI Components in
    ✤

         ActionScript 3.0

         Components are accessed via the Components Panel and are
    ✤

         automatically added to the Library when they are dragged to the
         stage

         In the example, components are configured using the Properties/
    ✤

         Parameters panel, although this could also be done using the
         Component Properties panel or in ActionScript



Sunday, February 22, 2009                                                  20
HOT - Creating a Form



         Take a look at:
    ✤




               orderForm_Final.fla
          ✤




               orderForm.fla
          ✤




Sunday, February 22, 2009           21
Team Activity



         Begin working on storyboard
    ✤




         What role with prototypes play?
    ✤




         Finalize project plan
    ✤




Sunday, February 22, 2009                  22

Weitere ähnliche Inhalte

Andere mochten auch (20)

Basic Game Frameworks
Basic Game FrameworksBasic Game Frameworks
Basic Game Frameworks
 
Design Strategy
Design StrategyDesign Strategy
Design Strategy
 
Ecml2010 Slides
Ecml2010 SlidesEcml2010 Slides
Ecml2010 Slides
 
Technology Applications in Education and Training
Technology Applications in Education and TrainingTechnology Applications in Education and Training
Technology Applications in Education and Training
 
PLN4PD
PLN4PDPLN4PD
PLN4PD
 
Listen Richard
Listen RichardListen Richard
Listen Richard
 
Introduction to Games and Simulations
Introduction to Games and SimulationsIntroduction to Games and Simulations
Introduction to Games and Simulations
 
Media literacy workshop
Media literacy workshopMedia literacy workshop
Media literacy workshop
 
Kare Bins
Kare BinsKare Bins
Kare Bins
 
#svjun26 South Vermillion Community Schools
#svjun26 South Vermillion Community Schools#svjun26 South Vermillion Community Schools
#svjun26 South Vermillion Community Schools
 
Social Learning Part B
Social Learning Part BSocial Learning Part B
Social Learning Part B
 
Eswc2009
Eswc2009Eswc2009
Eswc2009
 
Eswc2009
Eswc2009Eswc2009
Eswc2009
 
Digital Curation and Methods for Teaching Digital Literacy Skills
Digital Curation and Methods for Teaching Digital Literacy SkillsDigital Curation and Methods for Teaching Digital Literacy Skills
Digital Curation and Methods for Teaching Digital Literacy Skills
 
Applying Game Concepts To Learning
Applying Game Concepts To LearningApplying Game Concepts To Learning
Applying Game Concepts To Learning
 
Fanizzi Ilp2008 Dl Foil
Fanizzi Ilp2008 Dl FoilFanizzi Ilp2008 Dl Foil
Fanizzi Ilp2008 Dl Foil
 
Fanizzi Ilp2008 Kernel
Fanizzi Ilp2008 KernelFanizzi Ilp2008 Kernel
Fanizzi Ilp2008 Kernel
 
Bgp (1)
Bgp (1)Bgp (1)
Bgp (1)
 
Telecom Sourcing Accountibility
Telecom Sourcing AccountibilityTelecom Sourcing Accountibility
Telecom Sourcing Accountibility
 
Tuna Pax
Tuna PaxTuna Pax
Tuna Pax
 

Ähnlich wie Advanced ActionScript Concepts and Game Development

JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureSimon Willison
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
ArchGenXML / UML and Plone
ArchGenXML / UML and PloneArchGenXML / UML and Plone
ArchGenXML / UML and PloneJazkarta, Inc.
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsFlorian Weil
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishingGilbert Guerrero
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"Theo Rushin Jr
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Paris Android User Group
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MITjeresig
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpGoogleTecTalks
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementWannitaTolaema
 
Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07carsonsystems
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkitCocoaHeads Tricity
 
Silverlight: Designer and Developer Workflow
Silverlight: Designer and Developer WorkflowSilverlight: Designer and Developer Workflow
Silverlight: Designer and Developer Workflowroberto.design
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashGilbert Guerrero
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017ElifTech
 
Building an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonBuilding an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonJazkarta, Inc.
 
Silverlight 2 For Developers
Silverlight 2 For DevelopersSilverlight 2 For Developers
Silverlight 2 For DevelopersMithun T. Dhar
 

Ähnlich wie Advanced ActionScript Concepts and Game Development (20)

JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
ArchGenXML / UML and Plone
ArchGenXML / UML and PloneArchGenXML / UML and Plone
ArchGenXML / UML and Plone
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishing
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch Up
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory Management
 
Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit
 
Silverlight: Designer and Developer Workflow
Silverlight: Designer and Developer WorkflowSilverlight: Designer and Developer Workflow
Silverlight: Designer and Developer Workflow
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To Flash
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017
 
Building an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonBuilding an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / Poseidon
 
Silverlight 2 For Developers
Silverlight 2 For DevelopersSilverlight 2 For Developers
Silverlight 2 For Developers
 
Windows phone and azure
Windows phone and azureWindows phone and azure
Windows phone and azure
 

Mehr von University of West Florida (14)

Universities Without Borders
Universities Without BordersUniversities Without Borders
Universities Without Borders
 
MOOCs: Fact vs. Myth
MOOCs: Fact vs. MythMOOCs: Fact vs. Myth
MOOCs: Fact vs. Myth
 
Social Learning
Social LearningSocial Learning
Social Learning
 
Learning Verses Experience
Learning Verses ExperienceLearning Verses Experience
Learning Verses Experience
 
Social Learning Part A
Social Learning Part ASocial Learning Part A
Social Learning Part A
 
Social Communities
Social CommunitiesSocial Communities
Social Communities
 
The Social Web
The Social WebThe Social Web
The Social Web
 
Trivia/Quiz Games
Trivia/Quiz GamesTrivia/Quiz Games
Trivia/Quiz Games
 
Flash Word Games
Flash Word GamesFlash Word Games
Flash Word Games
 
Time-based Animation Games
Time-based Animation GamesTime-based Animation Games
Time-based Animation Games
 
Memory Deduction Games
Memory Deduction GamesMemory Deduction Games
Memory Deduction Games
 
Learning Game Implementation
Learning Game ImplementationLearning Game Implementation
Learning Game Implementation
 
Game Design Process
Game Design ProcessGame Design Process
Game Design Process
 
Learning Verses Experience
Learning Verses ExperienceLearning Verses Experience
Learning Verses Experience
 

Kürzlich hochgeladen

Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Kürzlich hochgeladen (20)

Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

Advanced ActionScript Concepts and Game Development

  • 1. Advanced ActionScript Concepts IT 7220 February 23, 2009 Sunday, February 22, 2009 1
  • 2. Agenda Syllabus Updates ✤ Game Assessment Papers ✤ Rosenzweig - ActionScript 3.0/Game Programming University ✤ Building Game Elements in ActionScript 3.0 ✤ HOT Lab - Flash Components and Forms ✤ Work in Project Teams ✤ Sunday, February 22, 2009 2
  • 3. Rosenzweig GP University Flash Game University (http://flashgameu.com/) ✤ Companion Website to Book ✤ Source code for all games referenced in text ✤ Video tutorials ✤ Blog ✤ Forums ✤ Sunday, February 22, 2009 3
  • 4. Rosenzweig Chap 1 Overview Review of Flash Interface ✤ ActionScript in timeline and using document class files ✤ Condition statements ✤ Loops - For, While, Do ✤ Use of Flash ActionScript Debugger ✤ Game Programming Checklist ✤ Sunday, February 22, 2009 4
  • 5. Simple ActionScript Program HelloWorld1.fla ✤ ActionScript in timeline, output using Trace Function ✤ Sunday, February 22, 2009 5
  • 6. Placing Objects on Stage HelloWorld2.fla ✤ Still working with ✤ ActionScript in the Timeline Create text field object ✤ Assign a value to it ✤ Place on stage (in display list) ✤ No text parameters for control ✤ Stage over placement or appearance (Display Object Container) of object Main Timeline (Display Object Container) TextField (Display Object) Sunday, February 22, 2009 6
  • 7. Document Class Library HelloWorld3.as ✤ All document classes are ✤ derived from either the MovieClip or Sprite class MovieClip class is a container ✤ class which includes the stage and timeline with each instance created This allows the text object to ✤ be added to the movie clip Document class must then be ✤ added to the Flash project file using the properties panel Sunday, February 22, 2009 7
  • 8. Rosenzweig Chap 2 Overview Creating and working with visual objects ✤ Player input ✤ Controlling animation with ActionScript ✤ Player Interaction via the Keyboard ✤ Accessing external data ✤ Arrays ✤ Sunday, February 22, 2009 8
  • 9. Visual Objects - Movie Clips We can add movie clips to our project by dragging them from the ✤ library to the stage, and then adjusting appearance using the properties panel It is also possible to add movie clips from the library solely with ✤ ActionScript, by setting the symbol linkage properties Lets take a look at the mascot movie clip in UsingMovieClips.fla ✤ The MC timeline has four layers to make it easier to change the ✤ animation a single part of the movie Sunday, February 22, 2009 9
  • 10. Create MC Objects - Flash Interface Drag as many instances of a movie clip symbol onto the stage as you ✤ want Position using select tool/properties ✤ Scale and rotate using free transform tool ✤ Sunday, February 22, 2009 10
  • 11. Create MC Objects - ActionScript First, we make the movie clip accessible to ActionScript by setting the ✤ Linkage properties (see Fig 2.2, p 43): enter Class name and select Export for ActionScript Next we use ActionScript to create a single instance on the stage at ✤ x=275, y=150, and rotating the movie clip 10º to the right Finally, using a For loop, we create 10 additional instances of the ✤ movie clip at y=300, spaced 150 pixels apart from each other, scaled at 50% of the size of the symbol class Sunday, February 22, 2009 11
  • 12. Button Creation in ActionScript Buttons can be made from either movie clips or button symbols stored ✤ in the library As we have seen, an event listener: ✤ objectName.addEventListener(MouseEvent.CLICK, objectFunction); is then used to link a button to an action Lets take a look at MakingButtons.fla ✤ Sunday, February 22, 2009 12
  • 13. Simple Shapes in ActionScript It is possible to create simple ✤ graphics entirely within ActionScript such as lines, rectangles, circles, and ellipses Closed shapes can also be filled ✤ in Lets take a look at ✤ DrawingShapes.fla Sunday, February 22, 2009 13
  • 14. Using Sprites in ActionScript The Sprite class is a basic display list building block: a display list ✤ node that can display graphics and can also contain children. A Sprite object is similar to a movie clip, but does not have a timeline. ✤ Sprite is an appropriate base class for objects that do not require timelines. For example, Sprite would be a logical base class for user interface (UI) components that typically do not use the timeline. The Sprite class is new in ActionScript 3.0. ✤ Lets take a look at CreatingSpriteGroups.fla ✤ Sunday, February 22, 2009 14
  • 15. Managing the Display List As we add objects to the display list, the last object added appears in ✤ front of previously added objects We manage the position of “children” on the stage using ✤ setChildIndex (first position is 0) Lets take a look at SettingSpriteDepth.fla ✤ Sunday, February 22, 2009 15
  • 16. User Input in ActionScript Mouse Input ✤ Use event listener to track mouse movement and rollover ✤ MouseInput.fla Keyboard Input ✤ Use event listeners to detect key press (requires ASCII codes) ✤ KeyboardInput.fla Text Input ✤ Using AS to set input type, properties and actions ✤ TextInput.fla Sunday, February 22, 2009 16
  • 17. User Interaction in ActionScript Many games allow interaction with an object using the arrow keys ✤ MovingSprites.fla Another common method of interaction is dragging an object using ✤ the mouse. The example creates an instance of the Point() class to track movement. DraggingSprites.fla Sunday, February 22, 2009 17
  • 18. Rosenzweig - Wrap-up Chapter 2 covers a lot things you can do with ActionScript for ✤ creating games Be sure to review the additional sections: ✤ Random numbers and Shuffling an Array ✤ Accessing external data ✤ Collision detection ✤ Animation examples ✤ Sunday, February 22, 2009 18
  • 19. HOT - Components and Forms You can create a form in html that includes text entry fields, check ✤ boxes, radio button, combo boxes, lists, etc. You can also set the tab order for the form elements to aid in usability. The contents of the form may then be submitted using either a form post method or by calling a script. Submitting form contents is generally via server-side script to tell ✤ what to do with the form contents. Scripts may be in JavaScript, Perl, ASP.NET, Visual Basic, or other scripting languages. Flash allows the creation of Forms, creating rich-content user ✤ applications using a set of pre-defined component classes which may be instantiated using the stage or through ActionScript. Sunday, February 22, 2009 19
  • 20. HOT - Working with Components Chap 15 builds a form in Flash using the Flash UI Components in ✤ ActionScript 3.0 Components are accessed via the Components Panel and are ✤ automatically added to the Library when they are dragged to the stage In the example, components are configured using the Properties/ ✤ Parameters panel, although this could also be done using the Component Properties panel or in ActionScript Sunday, February 22, 2009 20
  • 21. HOT - Creating a Form Take a look at: ✤ orderForm_Final.fla ✤ orderForm.fla ✤ Sunday, February 22, 2009 21
  • 22. Team Activity Begin working on storyboard ✤ What role with prototypes play? ✤ Finalize project plan ✤ Sunday, February 22, 2009 22