SlideShare a Scribd company logo
1 of 16
ARTDM 170, Week 9:
Encapsulation and Paper
      Prototypes
          Gilbert Guerrero
         gguerrero@dvc.edu
 gilbertguerrero.com/blog/artdm-170
Homework

• Please put your files in a folder with
  your last name and first initial
• Put the folder in my dropbox
• Example:
  
   smith-h
  
   
 MyAnimation.swf
         MyProjectDescription.pdf
Open Flash

• Create a new ActionScript 3.0
  document:
  
  
 MyEncap.fla
• Create a new ActionScript file:
  
   
   MyEncap.as
Encapsulation
Intro and Ending Screens

• To encapsulate a movie, use 3 frames
 ‣ 1st frame holds the intro screen and
     a button
 ‣   2nd frame holds the game or movie
 ‣   3rd frame holds a game over screen
     and a restart button
Flash Buttons
To create a button:
• Create a new symbol in the Library
• Symbol type: Button
• In a button, each frame is a button state:
  ‣ Up - no user interaction
  ‣ Over - user mouse hovers over
  ‣ Down - user clicks the button
  ‣ Hit - invisible shape defines whatʼs
    clickable
Encapsulation: Frame 1
In the first frame:
• Add a button to the stage
• Name the instance of the button “play_btn”
• Select the first frame and add this script:
play_btn.addEventListener(MouseEvent.CLICK,startGame);

function startGame(event:MouseEvent) {

	   gotoAndStop("playgame");

}

stop();
Encapsulation: Frame 2
•   Create a second frame
•   In the Properties panel, label the frame
    “playgame”
•   Create a MovieClip symbol in the Library
•   Right click on the symbol to open Properties...
    ‣ Click Export for Animation
    ‣ Enter your movieʼs class name in the class field,
      e.g. MyAnimation
•   Drop an instance of the symbol onto the stage and
    place it at (0,0) in the upper left corner of the
    stage
Encapsulation: Frame 3
In the third frame:
• Add a button to the stage
• Name the instance of the button “replay_btn”
• Select the first frame and add this script:
replay_btn.addEventListener(MouseEvent.CLICK,playAgain);

function playAgain(event:MouseEvent) {
   gotoAndStop("playgame");

}

    In a game, the final frame of the encapsulation
    would be your Game Over screen.
Getting to the third frame
Your encapsulated movie needs to provide a way to load
the third frame.
•       Create a variable in your ActionScript class
    public var bounceCount:Number = 0;

•       Add 1 to the variable each time an event occurs
    bounceCount++;

•       When the variable reaches its limit, send the movie to
        the “gameover” frame (you must refer to the root movie)
    if (bounceCount >= 10000) {
          MovieClip(root).gotoAndStop("gameover");

    }
Paper Prototypes
Building Paper Prototypes

• Cheap, easy, and effective
• Paper Prototyping on A List Apart
Arrays
Storing and Retrieving

• Arrays can be used to store data
  fruits = {“apples”,“oranges”,“bananas”}

• Data can be retrieved from arrays
  using the index numbers
  trace(fruits[0]); //apples
  trace(fruits[1]); //oranges
  trace(fruits[2]); //bananas

  // I like to eat apples and oranges.
  trace("I like to eat "+fruits[0]+" and "+fruits[1]+".");


• More about Arrays next week...
Randomization

• Generate a random number between 0
  and .999999
Math.random()

• Round down using Math.floor and to
  multiply Math.random by a number
  get a random integer between zero and
  your number
//generates integers from 0 to 29
Math.floor(Math.random()*30)
Homework, due Oct 21

• Read Chapter 5: Arrays in the
  ActionScript 3.0 Cookbook, p103-136. 
• Be sure you learn about these
  functions:
 ‣  array.push()
 ‣  array.splice()
 ‣  array.concat()
 ‣  and Looping through an Array (see
    section 5.2)

More Related Content

Viewers also liked

LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSON
LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSONLETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSON
LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSONNicole Jinn
 
Lions Club Secretary Responsibilites 2013-2014
Lions Club Secretary Responsibilites   2013-2014Lions Club Secretary Responsibilites   2013-2014
Lions Club Secretary Responsibilites 2013-2014m nagaRAJU
 
Jornada_centres_innovadors_de_Catalunya
Jornada_centres_innovadors_de_CatalunyaJornada_centres_innovadors_de_Catalunya
Jornada_centres_innovadors_de_Catalunyaevaristogonzal2
 
Tecla Gruppo presentazione
Tecla Gruppo presentazioneTecla Gruppo presentazione
Tecla Gruppo presentazioneCarlo Visani
 
ARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesGilbert Guerrero
 
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...Caroline Reis Gonçalves
 
Patent universiade
Patent universiadePatent universiade
Patent universiadeAnna Jo
 
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...Ghislain Delabie
 

Viewers also liked (12)

LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSON
LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSONLETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSON
LETTER_CLBCELIGIBILITY_NICOLEJINN_MLAWILKINSON
 
GCLP
GCLPGCLP
GCLP
 
CV English
CV EnglishCV English
CV English
 
Lions Club Secretary Responsibilites 2013-2014
Lions Club Secretary Responsibilites   2013-2014Lions Club Secretary Responsibilites   2013-2014
Lions Club Secretary Responsibilites 2013-2014
 
Jornada_centres_innovadors_de_Catalunya
Jornada_centres_innovadors_de_CatalunyaJornada_centres_innovadors_de_Catalunya
Jornada_centres_innovadors_de_Catalunya
 
Tecla Gruppo presentazione
Tecla Gruppo presentazioneTecla Gruppo presentazione
Tecla Gruppo presentazione
 
ARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation Schemes
 
Drugstore market 21 oct 2016
Drugstore market  21 oct 2016Drugstore market  21 oct 2016
Drugstore market 21 oct 2016
 
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...
Fisiopatologia do Câncer de Ovários - Apresentação de artigo - New insights i...
 
Patent universiade
Patent universiadePatent universiade
Patent universiade
 
5.disoluciones.
5.disoluciones.5.disoluciones.
5.disoluciones.
 
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...
Nouvelles mobilités : quel rôle pour la transition énergétique ? Automobil...
 

Similar to ARTDM 170, Week9: Encapsulation + Paper Prototypes

ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityGilbert Guerrero
 
Actionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEActionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEOUM SAOKOSAL
 
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196Mahmoud Samir Fayed
 
Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) TutorialPEI-YAO HUNG
 
Chapter ii(coding)
Chapter ii(coding)Chapter ii(coding)
Chapter ii(coding)Chhom Karath
 
Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3Reese Mills
 
ARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To FlashARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To FlashGilbert Guerrero
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2Kobkrit Viriyayudhakorn
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3dDao Tung
 
controlling_animations
controlling_animationscontrolling_animations
controlling_animationstutorialsruby
 
controlling_animations
controlling_animationscontrolling_animations
controlling_animationstutorialsruby
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashGilbert Guerrero
 
Green My Place Game7 Switch Search
Green My Place Game7 Switch SearchGreen My Place Game7 Switch Search
Green My Place Game7 Switch SearchBen Cowley
 
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Kobkrit Viriyayudhakorn
 

Similar to ARTDM 170, Week9: Encapsulation + Paper Prototypes (20)

ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting Interactivity
 
Ninja Cat Flyer - 3 of 6
Ninja Cat Flyer - 3 of 6Ninja Cat Flyer - 3 of 6
Ninja Cat Flyer - 3 of 6
 
Actionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDEActionscript 3 - Session 2 Getting Started Flash IDE
Actionscript 3 - Session 2 Getting Started Flash IDE
 
Apps in a Flash HCI
Apps in a Flash HCIApps in a Flash HCI
Apps in a Flash HCI
 
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196
 
Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) Tutorial
 
Python lecture 10
Python lecture 10Python lecture 10
Python lecture 10
 
Chapter ii(coding)
Chapter ii(coding)Chapter ii(coding)
Chapter ii(coding)
 
Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3Scaleform Mini-Games Tutorial 1/3
Scaleform Mini-Games Tutorial 1/3
 
ARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To FlashARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To Flash
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
 
test
testtest
test
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
 
controlling_animations
controlling_animationscontrolling_animations
controlling_animations
 
controlling_animations
controlling_animationscontrolling_animations
controlling_animations
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To Flash
 
Action script
Action scriptAction script
Action script
 
Green My Place Game7 Switch Search
Green My Place Game7 Switch SearchGreen My Place Game7 Switch Search
Green My Place Game7 Switch Search
 
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
 
Presentation 8.pptx
Presentation 8.pptxPresentation 8.pptx
Presentation 8.pptx
 

More from Gilbert Guerrero

Designing for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightDesigning for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightGilbert Guerrero
 
ARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAGilbert Guerrero
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishingGilbert Guerrero
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysGilbert Guerrero
 
ARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingGilbert Guerrero
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interactionGilbert Guerrero
 
Artdm 171 Week12 Templates
Artdm 171 Week12 TemplatesArtdm 171 Week12 Templates
Artdm 171 Week12 TemplatesGilbert Guerrero
 
ARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsGilbert Guerrero
 
ARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceGilbert Guerrero
 
ARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceGilbert Guerrero
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 

More from Gilbert Guerrero (20)

Designing for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightDesigning for Skepticism and Bright Sunlight
Designing for Skepticism and Bright Sunlight
 
ARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QA
 
Artdm 171 week15 seo
Artdm 171 week15 seoArtdm 171 week15 seo
Artdm 171 week15 seo
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishing
 
ARTDM 171, Week 14: Forms
ARTDM 171, Week 14: FormsARTDM 171, Week 14: Forms
ARTDM 171, Week 14: Forms
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + Arrays
 
ARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to Processing
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interaction
 
Artdm 171 Week12 Templates
Artdm 171 Week12 TemplatesArtdm 171 Week12 Templates
Artdm 171 Week12 Templates
 
ARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page Comps
 
ARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User Experience
 
ARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping Cyberspace
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm171 Week6 Images
Artdm171 Week6 ImagesArtdm171 Week6 Images
Artdm171 Week6 Images
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

ARTDM 170, Week9: Encapsulation + Paper Prototypes

  • 1. ARTDM 170, Week 9: Encapsulation and Paper Prototypes Gilbert Guerrero gguerrero@dvc.edu gilbertguerrero.com/blog/artdm-170
  • 2. Homework • Please put your files in a folder with your last name and first initial • Put the folder in my dropbox • Example: smith-h MyAnimation.swf MyProjectDescription.pdf
  • 3. Open Flash • Create a new ActionScript 3.0 document: MyEncap.fla • Create a new ActionScript file: MyEncap.as
  • 5. Intro and Ending Screens • To encapsulate a movie, use 3 frames ‣ 1st frame holds the intro screen and a button ‣ 2nd frame holds the game or movie ‣ 3rd frame holds a game over screen and a restart button
  • 6. Flash Buttons To create a button: • Create a new symbol in the Library • Symbol type: Button • In a button, each frame is a button state: ‣ Up - no user interaction ‣ Over - user mouse hovers over ‣ Down - user clicks the button ‣ Hit - invisible shape defines whatʼs clickable
  • 7. Encapsulation: Frame 1 In the first frame: • Add a button to the stage • Name the instance of the button “play_btn” • Select the first frame and add this script: play_btn.addEventListener(MouseEvent.CLICK,startGame); function startGame(event:MouseEvent) { gotoAndStop("playgame"); } stop();
  • 8. Encapsulation: Frame 2 • Create a second frame • In the Properties panel, label the frame “playgame” • Create a MovieClip symbol in the Library • Right click on the symbol to open Properties... ‣ Click Export for Animation ‣ Enter your movieʼs class name in the class field, e.g. MyAnimation • Drop an instance of the symbol onto the stage and place it at (0,0) in the upper left corner of the stage
  • 9. Encapsulation: Frame 3 In the third frame: • Add a button to the stage • Name the instance of the button “replay_btn” • Select the first frame and add this script: replay_btn.addEventListener(MouseEvent.CLICK,playAgain); function playAgain(event:MouseEvent) { gotoAndStop("playgame"); } In a game, the final frame of the encapsulation would be your Game Over screen.
  • 10. Getting to the third frame Your encapsulated movie needs to provide a way to load the third frame. • Create a variable in your ActionScript class public var bounceCount:Number = 0; • Add 1 to the variable each time an event occurs bounceCount++; • When the variable reaches its limit, send the movie to the “gameover” frame (you must refer to the root movie) if (bounceCount >= 10000) { MovieClip(root).gotoAndStop("gameover"); }
  • 12. Building Paper Prototypes • Cheap, easy, and effective • Paper Prototyping on A List Apart
  • 14. Storing and Retrieving • Arrays can be used to store data fruits = {“apples”,“oranges”,“bananas”} • Data can be retrieved from arrays using the index numbers trace(fruits[0]); //apples trace(fruits[1]); //oranges trace(fruits[2]); //bananas // I like to eat apples and oranges. trace("I like to eat "+fruits[0]+" and "+fruits[1]+"."); • More about Arrays next week...
  • 15. Randomization • Generate a random number between 0 and .999999 Math.random() • Round down using Math.floor and to multiply Math.random by a number get a random integer between zero and your number //generates integers from 0 to 29 Math.floor(Math.random()*30)
  • 16. Homework, due Oct 21 • Read Chapter 5: Arrays in the ActionScript 3.0 Cookbook, p103-136.  • Be sure you learn about these functions: ‣ array.push() ‣ array.splice() ‣ array.concat() ‣ and Looping through an Array (see section 5.2)