Home » Archive

Articles in the ActionScript 2.0 Category

ActionScript 2.0, ActionScript 3.0, Flash CS4, Flash CS5, Flex »

[12 Mar 2011 | 2 Comments | ]

Maths and ActionScript together makes nice Flash effects like particles effect and Flash games that we play daily. Today, lets take a
look at ActionScripting in Maths.
Distance between two points:
Pass the two points as arguments to get the resulting distance between two points.
public function distance(p1:Point, p2:Point):Number {
var dx:Number = p2.x-p1.x;
var dy:Number = p2.y-p1.y;

return Math.sqrt(dx*dx + dy*dy);
Angle/Rotation between two points:
Need to pass the four arguments to get the Angle, (X1,Y1) pointA and (X2,Y2) pointB.
function getAngle (x1:Number, y1:Number, x2:Number, y2:Number):Number
var dx:Number = x2 – x1;

ActionScript 2.0, ActionScript 3.0, AIR, Flash CS4, Flash CS5, Flex »

[22 Feb 2011 | No Comment | ]

Try catch stament in actionscript used when an exceptional error accours. This article deals with when and how to use Try catch statement in actionscript 3.0 – Flash.
In this article we are going to cover the following topics.

try/catch Statement in actionscript 3
Basic try/catch Statement Syntax
Throwing Exceptions in Actionscript
Finally in Actionscript 3

Previous article about actionscript basics part 6
The below example code are used in Actionscript 3.0
try/catch Statement in actionscript 3
The try/catch statement encloses some code and is used to handle errors and exceptions that might occur in that code. Exceptions …

ActionScript 2.0, ActionScript 3.0, AIR, Flash CS4, Flash CS5, Flex »

[21 Feb 2011 | No Comment | ]

flash player download or adobe flash player download can be done in the adobe website. Flash player is the virtual machine that executes the byte code generated by Flash authoring environment. Adobe Flash player is a stand alone piece of code which executes the SWF files generated by Adobe Flash, Adobe Flex and other open source Flash authoring tools.
Requirements for flash player download and Install:
· Processor: Intel Pentium II 450MHz, AMD Athlon 600MHz or faster processor (or equivalent)
· Memory: 128MB of RAM
· Graphics memory: 128MB of graphics memory
· Internet Explorer …

ActionScript 2.0, ActionScript 3.0, AIR, Flash CS4, Flash CS5 »

[8 Feb 2011 | No Comment | ]

To simulate / test a project with preloader created in Flash authoring environment, means to test and see how preloader works in the particular project, then follow the steps below in Adobe Flash CS5 or lower version Adobe Flash CS4.
Animated Flash/Flex Circle Preloader sample

Download the Flash animated preloader source file

In Flash Authoring Tool – Adobe Flash cs5
- Create a New Flash Project or CTRL + N.
- Import a Image into Stage, if Image is added into library drag it to stage or CTRL + R.
- Press Ctrl + Enter or …

ActionScript 2.0, ActionScript 3.0, Flash CS4, Flex, HTML5 »

[20 Dec 2010 | No Comment | ]

This article discuss how to open a HTML popup window in Flash or Flex using ActionScript and JavaScript.
The Idea is to call the “open” method of the Window Object in JavaScript. Unlike in Standard Javascript function which will be embedded in HTML. Here we will embed the JavaScript function inside the Flash actionscript which communicates to browser to direct and open a new Window.
ActionScript code to Open Popup window in as3
Window_mc.addEventListener(MouseEvent.MOUSE_DOWN, OpenWindowFunction);
function OpenWindowFunction(e:MouseEvent):void {
var jscommand:String = “window.open(‘http://www.designscripting.com’,'win’,'height=200,