SlideShare a Scribd company logo
1 of 4
Download to read offline
Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007
Jukka Paasonen 1(4)
Creating rich Internet applications has become more easier but also more demanding.
Flex 2 SDK and FlashDevelop3 offers an free way of building Flash 9 applications.
This document describes how to install the latest versions of these tools and how to start
some initial Flash programming.
Installation
First download Flex 2 SDK from Adobe.com:
http://www.adobe.com/products/flex/downloads/
http://download.macromedia.com/pub/flex/sdk/flex2_sdk_hf1.zip
FlashDevelop3 also works with the beta version of Flex SDK, in case you wish to use that. It
offers the possibility to compile Air applications for example.
Second thing is to get the latest FlashDevelop3. You can download it from:
http://www.flashdevelop.org/community/index.php
section “releases”. As the time of writing, it is beta 3.
If you like to try out the latest development build, go to:
http://www.flashdevelop.org/community/viewtopic.php?t=1734
Installation is rather straight forward, unzip the Flex 2 SDK wherever you like and after
installing FlashDevelop3, change the AS3 plugin settings to point in the Flex SDK directory.
This can be found from “Tools – Installed Plugins – AS3Context”. Image 1 hopefully clears
this a bit.
Image 1. FlashDevelop3 AS3Context plugin settings dialog.
Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007
Jukka Paasonen 2(4)
Programming
Writing code in plain Actionscript 3, which then in turn is compiled to AVM2 byte code by
using Flex SDK, requires some additional care.
Each file you write must belong to a package. You can consider this to be a hint for the
compiler of what are the limits of your codes scope.
Usually when writing code in Flash authoring tool, the tool itself takes care of this and the
scope is usually the movie clip you are working on.
Another thing is to note that Actionscript 3 is heavily Object Oriented and you should
always use classes, possibly extending those, which already exist in the SDK.
The short example here shows how the structure of Actionscript 3 class looks like, complete
file (FlagFinland.as) available at http://paazio.nanbudo.fi/, where you downloaded this
document too.
The basic structure usually follows the formula below:
package {
import flash.display.Sprite;
import flash.events.Event;
[SWF(width="360", height="220", frameRate="33", backgroundColor="#FFFFFF")]
public class FlagFinland extends Sprite {
public function FlagFinland() {
this.loaderInfo.addEventListener(Event.INIT, init);
}
private function init(evt:Event):void {
// Draw graphics here...
}
}
}
This time I will build an small application to draw the Finnish flag. For that, I need to add
some more imports:
Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007
Jukka Paasonen 3(4)
import flash.display.Graphics;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageDisplayState;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;
Notice the several “Stage...” imports. They are all used to set proper scaling and alignment.
These are usually set in the constructor function:
public function FlagFinland() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.quality = StageQuality.MEDIUM;
stage.addEventListener(Event.RESIZE, onResize);
this.loaderInfo.addEventListener(Event.INIT, init);
}
There are two event listeners defined. The first one for resizing and the second to be run
when the whole flash file has been loaded:
private function init(evt:Event):void {
drawFlag();
}
private function onResize(evt:Event):void {
drawFlag();
}
Both of these call the same function, which in turn will do the drawing. That function and
the complete package is available at http://paazio.nanbudo.fi/
Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007
Jukka Paasonen 4(4)
Compiling of the file is easy, just click on the “Build Current File” button on the toolbar, as
shown in image 2.
Image 2. Toolbar with the compile button hovered.

More Related Content

Viewers also liked

Speedpresentatie Geavanceerd Zoeken
Speedpresentatie Geavanceerd ZoekenSpeedpresentatie Geavanceerd Zoeken
Speedpresentatie Geavanceerd ZoekenNienkeMcMurter
 
Design implementation imporovements with QML
Design implementation imporovements with QMLDesign implementation imporovements with QML
Design implementation imporovements with QMLJuga Paazmaya
 
Flash MX Tutorial - Preloader
Flash MX Tutorial - PreloaderFlash MX Tutorial - Preloader
Flash MX Tutorial - PreloaderJuga Paazmaya
 
Two Caged Tigers
Two Caged TigersTwo Caged Tigers
Two Caged TigersThea Westra
 
Pfizer
PfizerPfizer
PfizerP_100
 
Welcom online
Welcom onlineWelcom online
Welcom onlineP_100
 
Tekko Process 2003 Autumn
Tekko Process 2003 AutumnTekko Process 2003 Autumn
Tekko Process 2003 AutumnJuga Paazmaya
 
Flash MX Tutorial - Tweens
Flash MX Tutorial - TweensFlash MX Tutorial - Tweens
Flash MX Tutorial - TweensJuga Paazmaya
 
Educating The Next Generation Of Translation And Interpreters
Educating  The Next Generation Of Translation And InterpretersEducating  The Next Generation Of Translation And Interpreters
Educating The Next Generation Of Translation And Interpretersallinportuguese
 
Vette Klei
Vette KleiVette Klei
Vette KleiP_100
 
Flash MX Tutorial - Big wave
Flash MX Tutorial - Big waveFlash MX Tutorial - Big wave
Flash MX Tutorial - Big waveJuga Paazmaya
 
What Every Translator Should Know About Software Localization
What Every Translator Should Know About Software LocalizationWhat Every Translator Should Know About Software Localization
What Every Translator Should Know About Software Localizationallinportuguese
 
Flash MX Tutorial - Scrolling content
Flash MX Tutorial - Scrolling contentFlash MX Tutorial - Scrolling content
Flash MX Tutorial - Scrolling contentJuga Paazmaya
 
Mixing Computer-Assisted Translation and Machine Translation
Mixing Computer-Assisted Translation and Machine TranslationMixing Computer-Assisted Translation and Machine Translation
Mixing Computer-Assisted Translation and Machine Translationallinportuguese
 

Viewers also liked (16)

Speedpresentatie Geavanceerd Zoeken
Speedpresentatie Geavanceerd ZoekenSpeedpresentatie Geavanceerd Zoeken
Speedpresentatie Geavanceerd Zoeken
 
Design implementation imporovements with QML
Design implementation imporovements with QMLDesign implementation imporovements with QML
Design implementation imporovements with QML
 
Flash MX Tutorial - Preloader
Flash MX Tutorial - PreloaderFlash MX Tutorial - Preloader
Flash MX Tutorial - Preloader
 
Two Caged Tigers
Two Caged TigersTwo Caged Tigers
Two Caged Tigers
 
Testing In Java4278
Testing In Java4278Testing In Java4278
Testing In Java4278
 
Pfizer
PfizerPfizer
Pfizer
 
Powerpoint Opdracht 2
Powerpoint Opdracht 2Powerpoint Opdracht 2
Powerpoint Opdracht 2
 
Welcom online
Welcom onlineWelcom online
Welcom online
 
Tekko Process 2003 Autumn
Tekko Process 2003 AutumnTekko Process 2003 Autumn
Tekko Process 2003 Autumn
 
Flash MX Tutorial - Tweens
Flash MX Tutorial - TweensFlash MX Tutorial - Tweens
Flash MX Tutorial - Tweens
 
Educating The Next Generation Of Translation And Interpreters
Educating  The Next Generation Of Translation And InterpretersEducating  The Next Generation Of Translation And Interpreters
Educating The Next Generation Of Translation And Interpreters
 
Vette Klei
Vette KleiVette Klei
Vette Klei
 
Flash MX Tutorial - Big wave
Flash MX Tutorial - Big waveFlash MX Tutorial - Big wave
Flash MX Tutorial - Big wave
 
What Every Translator Should Know About Software Localization
What Every Translator Should Know About Software LocalizationWhat Every Translator Should Know About Software Localization
What Every Translator Should Know About Software Localization
 
Flash MX Tutorial - Scrolling content
Flash MX Tutorial - Scrolling contentFlash MX Tutorial - Scrolling content
Flash MX Tutorial - Scrolling content
 
Mixing Computer-Assisted Translation and Machine Translation
Mixing Computer-Assisted Translation and Machine TranslationMixing Computer-Assisted Translation and Machine Translation
Mixing Computer-Assisted Translation and Machine Translation
 

Similar to Actionscript 3 with FlashDevelop3

Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程yiditushe
 
Integrate Flex With Spring Framework
Integrate Flex With Spring FrameworkIntegrate Flex With Spring Framework
Integrate Flex With Spring FrameworkGuo Albert
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash PlatformPeter Elst
 
Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Ivan Ilijasic
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvcbgrynko
 
SPFx Team based Development using Docker
SPFx Team based Development using DockerSPFx Team based Development using Docker
SPFx Team based Development using DockerJenkins NS
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0Peter Elst
 
How to Get started with Press2Flash in 8 Steps
How to Get started with Press2Flash in 8 StepsHow to Get started with Press2Flash in 8 Steps
How to Get started with Press2Flash in 8 StepsErwan Jegouzo
 
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeThe Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeRedBlackTree
 
flex and flash platform
flex and flash platformflex and flash platform
flex and flash platformMuhammad Rodhy
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxmoirarandell
 
Introduction to Adobe Flex
Introduction to Adobe FlexIntroduction to Adobe Flex
Introduction to Adobe FlexAngelin R
 

Similar to Actionscript 3 with FlashDevelop3 (20)

Flex3中文教程
Flex3中文教程Flex3中文教程
Flex3中文教程
 
Integrate Flex With Spring Framework
Integrate Flex With Spring FrameworkIntegrate Flex With Spring Framework
Integrate Flex With Spring Framework
 
DIY Flex
DIY FlexDIY Flex
DIY Flex
 
DIY Flex
DIY FlexDIY Flex
DIY Flex
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash Platform
 
Flask
FlaskFlask
Flask
 
Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009Osvrt Na Adobe Max 2009
Osvrt Na Adobe Max 2009
 
Fltk tutorial
Fltk tutorialFltk tutorial
Fltk tutorial
 
Asp net mvc
Asp net mvcAsp net mvc
Asp net mvc
 
Flex and Java
Flex and JavaFlex and Java
Flex and Java
 
Adobe flex
Adobe flexAdobe flex
Adobe flex
 
SPFx Team based Development using Docker
SPFx Team based Development using DockerSPFx Team based Development using Docker
SPFx Team based Development using Docker
 
Another Test
Another TestAnother Test
Another Test
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
 
How to Get started with Press2Flash in 8 Steps
How to Get started with Press2Flash in 8 StepsHow to Get started with Press2Flash in 8 Steps
How to Get started with Press2Flash in 8 Steps
 
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeThe Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
 
flex and flash platform
flex and flash platformflex and flash platform
flex and flash platform
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
Introduction to Adobe Flex
Introduction to Adobe FlexIntroduction to Adobe Flex
Introduction to Adobe Flex
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 

Recently uploaded

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Recently uploaded (20)

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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...
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

Actionscript 3 with FlashDevelop3

  • 1. Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007 Jukka Paasonen 1(4) Creating rich Internet applications has become more easier but also more demanding. Flex 2 SDK and FlashDevelop3 offers an free way of building Flash 9 applications. This document describes how to install the latest versions of these tools and how to start some initial Flash programming. Installation First download Flex 2 SDK from Adobe.com: http://www.adobe.com/products/flex/downloads/ http://download.macromedia.com/pub/flex/sdk/flex2_sdk_hf1.zip FlashDevelop3 also works with the beta version of Flex SDK, in case you wish to use that. It offers the possibility to compile Air applications for example. Second thing is to get the latest FlashDevelop3. You can download it from: http://www.flashdevelop.org/community/index.php section “releases”. As the time of writing, it is beta 3. If you like to try out the latest development build, go to: http://www.flashdevelop.org/community/viewtopic.php?t=1734 Installation is rather straight forward, unzip the Flex 2 SDK wherever you like and after installing FlashDevelop3, change the AS3 plugin settings to point in the Flex SDK directory. This can be found from “Tools – Installed Plugins – AS3Context”. Image 1 hopefully clears this a bit. Image 1. FlashDevelop3 AS3Context plugin settings dialog.
  • 2. Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007 Jukka Paasonen 2(4) Programming Writing code in plain Actionscript 3, which then in turn is compiled to AVM2 byte code by using Flex SDK, requires some additional care. Each file you write must belong to a package. You can consider this to be a hint for the compiler of what are the limits of your codes scope. Usually when writing code in Flash authoring tool, the tool itself takes care of this and the scope is usually the movie clip you are working on. Another thing is to note that Actionscript 3 is heavily Object Oriented and you should always use classes, possibly extending those, which already exist in the SDK. The short example here shows how the structure of Actionscript 3 class looks like, complete file (FlagFinland.as) available at http://paazio.nanbudo.fi/, where you downloaded this document too. The basic structure usually follows the formula below: package { import flash.display.Sprite; import flash.events.Event; [SWF(width="360", height="220", frameRate="33", backgroundColor="#FFFFFF")] public class FlagFinland extends Sprite { public function FlagFinland() { this.loaderInfo.addEventListener(Event.INIT, init); } private function init(evt:Event):void { // Draw graphics here... } } } This time I will build an small application to draw the Finnish flag. For that, I need to add some more imports:
  • 3. Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007 Jukka Paasonen 3(4) import flash.display.Graphics; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageDisplayState; import flash.display.StageQuality; import flash.display.StageScaleMode; import flash.events.Event; Notice the several “Stage...” imports. They are all used to set proper scaling and alignment. These are usually set in the constructor function: public function FlagFinland() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.quality = StageQuality.MEDIUM; stage.addEventListener(Event.RESIZE, onResize); this.loaderInfo.addEventListener(Event.INIT, init); } There are two event listeners defined. The first one for resizing and the second to be run when the whole flash file has been loaded: private function init(evt:Event):void { drawFlag(); } private function onResize(evt:Event):void { drawFlag(); } Both of these call the same function, which in turn will do the drawing. That function and the complete package is available at http://paazio.nanbudo.fi/
  • 4. Actionscript 3 with FlashDevelop3 v1.0 : 14/11/2007 Jukka Paasonen 4(4) Compiling of the file is easy, just click on the “Build Current File” button on the toolbar, as shown in image 2. Image 2. Toolbar with the compile button hovered.