NOGDUS $1670.00 has been donated to NOGDUS!
September 20, 2017, 08:19:41 PM *
Welcome, Guest. Please login or register.

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

Respect: 20
« 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.

Code:
//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!");
}

}

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

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
.: Theme by Richard Marks :.
Valid XHTML 1.0! Valid CSS!