September 24, 2018, 04:16:41 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
   Home   Blogs Help Search Tags Login Register  
Pages: [1]   Go Down
Author Topic: Introduction to Actionscript 3  (Read 2020 times)
0 Members and 1 Guest are viewing this topic.

Respect: 20
Offline Offline

Posts: 8

« on: September 22, 2009, 11:09:16 AM »

Actionscript 3 is an event driven, Object Oriented scripting language which runs through Adobe's Shockwave Flash Player. It's syntax is based on Ecmascript and overall I find it to be very similar to Java. The main difference I have found is how variables are typed and the ability to have dynamically typed variables (but this is bad practice and will slow down the interpreter)

Here is the tradition Hello World in as3.

//this is a comment
* and so is this

//the package name is often the domain name in reverse, the same as java
package com.gnoll.helloworld

/*we name the class here, this is the same as java
* the root class always extends Sprite for compiling with flex, or MovieClip for flash
* this means you can access all the properties like the 'stage' of the flash player
public class HelloWorld extends Sprite

//this is the constructor, also the same as java :)
public function HelloWorld()
/* the trace function is global and temporarily outputs the string
* to a log file (which is in different locations depending on your OS)
* and this is read by debuggers for flash applications
trace("Hello, world!");


Tags: actionscript as3 introduction 
Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!