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

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

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