SlideShare a Scribd company logo
1 of 33
Coding Flash :
ActionScript(3.0) Tutorial
            Pei-Yao (Perry) Hung

               peiyaoh@umich.edu
  School of Information, University of Michigan
Outline

• ActionScript Basics
• Interface & Animation
• Reference
ActionScript Basics
Basics I
• Variable Declaration :
 • var i:Number;
• Flow Control
 • for, if-else, ...
• Code Using
 • include “your_code_filename”
Basic II
• Function Declaration
 • function MyFunction(i:Number):Number
   • function function_name(parameter:
      parameter_type): return_value_type
• Command-line Message Output
 • trace(“Print message : ” + your_msg)
Basic III
• Class, Package Using
 • import your_class_name
• Inherit
 • a_class_name extends b_class_name
• Return Value
 • return return_value
Sample Code List

• HelloWorld.*: use code in .fla
• HelloWorld2.*: use “include” to use .as
• HelloWorld3.*: use “import” to use .as
• HelloWorld4.*: use “extends” to use .as
Interface & Animation
DisplayObject
 Components you can see
Display Object
        Hierarchy I
• All the display objects on the screen are
  organized through parent - child
  relationship (start from “root”)
• Only display objects in the display hierarchy
  will be displayed
• Children work as a group( under same
  parent ) with parent. ex. move, resize ...
Display Object
    Hierarchy II
Parent’s Parent

    Parent

        Child     Child
Display Object
        Hierarchy III
• Code : use parent.addChild(child) to form
  the parent-child relationship
• The last added child is the top most child
  you can see (with the biggest z-index)
• Demo : ParentChild.fla (Key:
  Up,Down,Left,Right,Space,Shift,b,l,a,A,v,r)
Interaction
Respond to the Event
Event I

• MouseEvent
 • Down, Move, Up, Click ...
• KeyboardEvent
 • Down, UP, ...
Event II
• Registers to event with event handler
 • addEventListener(event:String,
    eventHandler)
• Unregisters event handler to event
 • removeEventListener(event:String,
    eventHandler)
• Demo : ParentChild.fla
MovieClip
Display Object container with canvas and frames
MovieClip I
• Basic Property
 • x, y, width, height, rotation
 • scaleX, scaleY
 • mouseX, mouseY
 • alpha, visible
• Demo : ParentChild.fla
MovieClip II
• Use property “graphics” to draw line
 • lineStyle() : line setting
 • moveTo() : moves your pen
 • lineTo() : draws the line (start from
    where your pen is)
• Demo : MovieClipCanvas.fla
MovieClip III
• Use property “graphics” to fill region
 • beginFill() : fill setting
 • Draw line as border of the region
 • endFill() : fill the region
 • clear() : clear your drawing and setting
• Demo : MovieClipCanvas.fla
MovieClip IV
• Detect collision between movieclip
 • mc1.hitTestObject( mc2 )
   • check if bounding box overlapped
 • mc1.hitTestPoint( x, y, shapFlag:boolean)
   • use shapFlag to determine whether to
      check the actual pixel instead of
      bounding box.
MovieClip V
• Play with Scene, Frame
 • gotoAndPlay(frame_number,
    "scene_name");
 • stop() : stop in the current frame
• Demo : BatBirdGame.fla
 • Scene, Frame, library component extends
    class
There are still many
  useful classes ...
Useful Classes
• SharedObject : act like cookie
• Mask : reveal only some part of display
  object
• Timer : do things periodically
• TransitionManager : apply some typical
  animation without too much effort
Library
Other talented developers already done them
Other Library I

• as3corelib : Conatins png, jpeg encoder, ...
 • http://code.google.com/p/as3corelib/
• papervision3d : 3D engine
 • http://code.google.com/p/papervision3d/
Other Library II

• Adobe AIR : Build Desktop Application
 • http://www.adobe.com/products/air/
• mdm : Build Executable (.exe)
 • http://www.multimedia.com/
Still not satisfied?
Find other learning resource & reference
Reference Books

• Essential ActionScript 3.0
 • Breadth
• ActionScript 3.0 Cookbook
 • Quick manual, classic sample code
Reference Webpages I
• Flash Help
 • ActionScript 3.0 Language and
    Components Reference
 • Programming ActionScript 3.0
• Adobe AIR:
 • http://help.adobe.com/en_US/AS3LCR/
    Flash_10.0/index.html
Reference Webpages II

• Papervision3d
 • http://www.papervision3d.org/docs/as3/
• MDM
 • http://multidmedia.com/support/livedocs/
Reference Blogs
•   My Flash Note : http://flashpeiyaoh.blogspot.com/

•   http://qops.blogspot.com/feeds/posts/default

•   http://ticore.blogspot.com/feeds/posts/default

•   http://erinylin.blogspot.com/feeds/posts/default

•   http://www.luar.com.hk/flashbook/index.rdf

•   http://blog.yam.com/rss.php?blog_id=milkmidi&ver=2.0

•   http://benbenstudio.blogspot.com/feeds/posts/default

•   http://diary.tw/allenliao/index.xml
Q &A
Thanks

More Related Content

Viewers also liked

Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3OUM SAOKOSAL
 
Actionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashActionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashOUM SAOKOSAL
 
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...Eka Zay
 
ActionScript Presentation
ActionScript PresentationActionScript Presentation
ActionScript PresentationNwahsav
 
Desain pembelajaran dick and carey pada mata diklat k3
Desain pembelajaran dick and carey pada mata diklat k3Desain pembelajaran dick and carey pada mata diklat k3
Desain pembelajaran dick and carey pada mata diklat k3Syaifi Al-Mahfudzi
 
Actionscript
ActionscriptActionscript
Actionscriptsaysam
 
Pesawat sederhana
Pesawat sederhanaPesawat sederhana
Pesawat sederhanaSamantars17
 
Metode Penelitian - Dick and Carey
Metode Penelitian - Dick and CareyMetode Penelitian - Dick and Carey
Metode Penelitian - Dick and CareyDinar Firda Rosa
 
Actionscript
ActionscriptActionscript
Actionscriptyyurany
 
Model Desain Sistem Pembelajaran Dick and Carey
Model Desain Sistem Pembelajaran Dick and CareyModel Desain Sistem Pembelajaran Dick and Carey
Model Desain Sistem Pembelajaran Dick and CareyBambang Karyadi
 
Regegresi sederhana ayda tri_valen_virdya
Regegresi sederhana ayda tri_valen_virdyaRegegresi sederhana ayda tri_valen_virdya
Regegresi sederhana ayda tri_valen_virdyaAyda Fitriani
 
Adobe Flash History and Basics
Adobe Flash History and BasicsAdobe Flash History and Basics
Adobe Flash History and BasicsTasawr Interactive
 
Rumusan dan pengembangan indikator
Rumusan dan pengembangan indikatorRumusan dan pengembangan indikator
Rumusan dan pengembangan indikatorAerwant Lanut
 
AppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes
 

Viewers also liked (19)

Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3Actionscript 3 - Session 1 Introduction To As 3
Actionscript 3 - Session 1 Introduction To As 3
 
Actionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashActionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And Flash
 
PENGEMBANGAN SISTEM PEMBELAJARAN
PENGEMBANGAN SISTEM PEMBELAJARANPENGEMBANGAN SISTEM PEMBELAJARAN
PENGEMBANGAN SISTEM PEMBELAJARAN
 
Jawaban psb semester genap
Jawaban psb semester genapJawaban psb semester genap
Jawaban psb semester genap
 
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...
Pengembangan indikator, tujuan pembelajaran, pengembangan materi, kegiatan pe...
 
ActionScript Presentation
ActionScript PresentationActionScript Presentation
ActionScript Presentation
 
Model pengembangan dick and carrey
Model pengembangan dick and carreyModel pengembangan dick and carrey
Model pengembangan dick and carrey
 
Desain pembelajaran dick and carey pada mata diklat k3
Desain pembelajaran dick and carey pada mata diklat k3Desain pembelajaran dick and carey pada mata diklat k3
Desain pembelajaran dick and carey pada mata diklat k3
 
Actionscript
ActionscriptActionscript
Actionscript
 
Pesawat sederhana
Pesawat sederhanaPesawat sederhana
Pesawat sederhana
 
Metode Penelitian - Dick and Carey
Metode Penelitian - Dick and CareyMetode Penelitian - Dick and Carey
Metode Penelitian - Dick and Carey
 
Actionscript
ActionscriptActionscript
Actionscript
 
Pengembangan indikator
Pengembangan indikatorPengembangan indikator
Pengembangan indikator
 
Model Desain Sistem Pembelajaran Dick and Carey
Model Desain Sistem Pembelajaran Dick and CareyModel Desain Sistem Pembelajaran Dick and Carey
Model Desain Sistem Pembelajaran Dick and Carey
 
Regegresi sederhana ayda tri_valen_virdya
Regegresi sederhana ayda tri_valen_virdyaRegegresi sederhana ayda tri_valen_virdya
Regegresi sederhana ayda tri_valen_virdya
 
Adobe Photoshop Cs3
Adobe Photoshop Cs3Adobe Photoshop Cs3
Adobe Photoshop Cs3
 
Adobe Flash History and Basics
Adobe Flash History and BasicsAdobe Flash History and Basics
Adobe Flash History and Basics
 
Rumusan dan pengembangan indikator
Rumusan dan pengembangan indikatorRumusan dan pengembangan indikator
Rumusan dan pengembangan indikator
 
AppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes - app store marketing toolbox
AppCodes - app store marketing toolbox
 

Similar to Coding Flash : ActionScript(3.0) Tutorial

Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashGilbert Guerrero
 
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
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev introVonbo
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone developmentVonbo
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangChris McEniry
 
introduction to c #
introduction to c #introduction to c #
introduction to c #Sireesh K
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliMark Billinghurst
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuerycolinbdclark
 
ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityGilbert Guerrero
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introductionSireesh K
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろうUnity Technologies Japan K.K.
 
JavaScript!
JavaScript!JavaScript!
JavaScript!RTigger
 
Html5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPraHtml5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPraKrzysztof Kotowicz
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQueryGill Cleeren
 
class and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxclass and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxAshrithaRokkam
 

Similar to Coding Flash : ActionScript(3.0) Tutorial (20)

Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To Flash
 
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
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev intro
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone development
 
On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
 
introduction to c #
introduction to c #introduction to c #
introduction to c #
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
 
Extjs
ExtjsExtjs
Extjs
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
 
ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting Interactivity
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
 
Python in 90 minutes
Python in 90 minutesPython in 90 minutes
Python in 90 minutes
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
 
Html5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPraHtml5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPra
 
17javascript.ppt
17javascript.ppt17javascript.ppt
17javascript.ppt
 
17javascript.ppt
17javascript.ppt17javascript.ppt
17javascript.ppt
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
class and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptxclass and object C++ language chapter 2.pptx
class and object C++ language chapter 2.pptx
 

More from PEI-YAO HUNG

Discount Expertise Metrics for Augmenting Community Interaction
Discount Expertise Metrics for Augmenting Community InteractionDiscount Expertise Metrics for Augmenting Community Interaction
Discount Expertise Metrics for Augmenting Community InteractionPEI-YAO HUNG
 
English Learning Resources at the University of Michigan
English Learning Resources at the University of MichiganEnglish Learning Resources at the University of Michigan
English Learning Resources at the University of MichiganPEI-YAO HUNG
 
Design Process Experience Sharing
Design Process Experience SharingDesign Process Experience Sharing
Design Process Experience SharingPEI-YAO HUNG
 
Aoide iDesign Presentation
Aoide iDesign PresentationAoide iDesign Presentation
Aoide iDesign PresentationPEI-YAO HUNG
 
Writing and Editing a News Story
Writing and Editing a News StoryWriting and Editing a News Story
Writing and Editing a News StoryPEI-YAO HUNG
 
Collective News Story: What Makes You Happy?
Collective News Story: What Makes You Happy?Collective News Story: What Makes You Happy?
Collective News Story: What Makes You Happy?PEI-YAO HUNG
 
Mobile UI Lo-Fi Prototype
Mobile UI Lo-Fi PrototypeMobile UI Lo-Fi Prototype
Mobile UI Lo-Fi PrototypePEI-YAO HUNG
 
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...PEI-YAO HUNG
 

More from PEI-YAO HUNG (9)

Discount Expertise Metrics for Augmenting Community Interaction
Discount Expertise Metrics for Augmenting Community InteractionDiscount Expertise Metrics for Augmenting Community Interaction
Discount Expertise Metrics for Augmenting Community Interaction
 
English Learning Resources at the University of Michigan
English Learning Resources at the University of MichiganEnglish Learning Resources at the University of Michigan
English Learning Resources at the University of Michigan
 
Design Process Experience Sharing
Design Process Experience SharingDesign Process Experience Sharing
Design Process Experience Sharing
 
Aoide iDesign Presentation
Aoide iDesign PresentationAoide iDesign Presentation
Aoide iDesign Presentation
 
Networking
NetworkingNetworking
Networking
 
Writing and Editing a News Story
Writing and Editing a News StoryWriting and Editing a News Story
Writing and Editing a News Story
 
Collective News Story: What Makes You Happy?
Collective News Story: What Makes You Happy?Collective News Story: What Makes You Happy?
Collective News Story: What Makes You Happy?
 
Mobile UI Lo-Fi Prototype
Mobile UI Lo-Fi PrototypeMobile UI Lo-Fi Prototype
Mobile UI Lo-Fi Prototype
 
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...
CuttingGame: A Computer Game to Assess & Train The Visual-Motor Integration A...
 

Recently uploaded

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Recently uploaded (20)

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 

Coding Flash : ActionScript(3.0) Tutorial

  • 1. Coding Flash : ActionScript(3.0) Tutorial Pei-Yao (Perry) Hung peiyaoh@umich.edu School of Information, University of Michigan
  • 2. Outline • ActionScript Basics • Interface & Animation • Reference
  • 4. Basics I • Variable Declaration : • var i:Number; • Flow Control • for, if-else, ... • Code Using • include “your_code_filename”
  • 5. Basic II • Function Declaration • function MyFunction(i:Number):Number • function function_name(parameter: parameter_type): return_value_type • Command-line Message Output • trace(“Print message : ” + your_msg)
  • 6. Basic III • Class, Package Using • import your_class_name • Inherit • a_class_name extends b_class_name • Return Value • return return_value
  • 7. Sample Code List • HelloWorld.*: use code in .fla • HelloWorld2.*: use “include” to use .as • HelloWorld3.*: use “import” to use .as • HelloWorld4.*: use “extends” to use .as
  • 10. Display Object Hierarchy I • All the display objects on the screen are organized through parent - child relationship (start from “root”) • Only display objects in the display hierarchy will be displayed • Children work as a group( under same parent ) with parent. ex. move, resize ...
  • 11. Display Object Hierarchy II Parent’s Parent Parent Child Child
  • 12. Display Object Hierarchy III • Code : use parent.addChild(child) to form the parent-child relationship • The last added child is the top most child you can see (with the biggest z-index) • Demo : ParentChild.fla (Key: Up,Down,Left,Right,Space,Shift,b,l,a,A,v,r)
  • 14. Event I • MouseEvent • Down, Move, Up, Click ... • KeyboardEvent • Down, UP, ...
  • 15. Event II • Registers to event with event handler • addEventListener(event:String, eventHandler) • Unregisters event handler to event • removeEventListener(event:String, eventHandler) • Demo : ParentChild.fla
  • 16. MovieClip Display Object container with canvas and frames
  • 17. MovieClip I • Basic Property • x, y, width, height, rotation • scaleX, scaleY • mouseX, mouseY • alpha, visible • Demo : ParentChild.fla
  • 18. MovieClip II • Use property “graphics” to draw line • lineStyle() : line setting • moveTo() : moves your pen • lineTo() : draws the line (start from where your pen is) • Demo : MovieClipCanvas.fla
  • 19. MovieClip III • Use property “graphics” to fill region • beginFill() : fill setting • Draw line as border of the region • endFill() : fill the region • clear() : clear your drawing and setting • Demo : MovieClipCanvas.fla
  • 20. MovieClip IV • Detect collision between movieclip • mc1.hitTestObject( mc2 ) • check if bounding box overlapped • mc1.hitTestPoint( x, y, shapFlag:boolean) • use shapFlag to determine whether to check the actual pixel instead of bounding box.
  • 21. MovieClip V • Play with Scene, Frame • gotoAndPlay(frame_number, "scene_name"); • stop() : stop in the current frame • Demo : BatBirdGame.fla • Scene, Frame, library component extends class
  • 22. There are still many useful classes ...
  • 23. Useful Classes • SharedObject : act like cookie • Mask : reveal only some part of display object • Timer : do things periodically • TransitionManager : apply some typical animation without too much effort
  • 25. Other Library I • as3corelib : Conatins png, jpeg encoder, ... • http://code.google.com/p/as3corelib/ • papervision3d : 3D engine • http://code.google.com/p/papervision3d/
  • 26. Other Library II • Adobe AIR : Build Desktop Application • http://www.adobe.com/products/air/ • mdm : Build Executable (.exe) • http://www.multimedia.com/
  • 27. Still not satisfied? Find other learning resource & reference
  • 28. Reference Books • Essential ActionScript 3.0 • Breadth • ActionScript 3.0 Cookbook • Quick manual, classic sample code
  • 29. Reference Webpages I • Flash Help • ActionScript 3.0 Language and Components Reference • Programming ActionScript 3.0 • Adobe AIR: • http://help.adobe.com/en_US/AS3LCR/ Flash_10.0/index.html
  • 30. Reference Webpages II • Papervision3d • http://www.papervision3d.org/docs/as3/ • MDM • http://multidmedia.com/support/livedocs/
  • 31. Reference Blogs • My Flash Note : http://flashpeiyaoh.blogspot.com/ • http://qops.blogspot.com/feeds/posts/default • http://ticore.blogspot.com/feeds/posts/default • http://erinylin.blogspot.com/feeds/posts/default • http://www.luar.com.hk/flashbook/index.rdf • http://blog.yam.com/rss.php?blog_id=milkmidi&ver=2.0 • http://benbenstudio.blogspot.com/feeds/posts/default • http://diary.tw/allenliao/index.xml
  • 32. Q &A