Home » Archive

Articles in the ActionScript 2.0 Category

ActionScript 2.0, ActionScript 3.0, Flex »

[20 Dec 2010 | No Comment | ]

Modulus operator(%)
Mod operator or Modulus Operator( % ) and it has other name called remainder operator is to devide two numbers and returns the remainder.
Syntax:
Result = Number1 % Number2
Note:
Result will contain the remainder in it.
Modulus operator in action
% operator can be used to find a number is Odd or Even
To find a given Number ODD or EVEN
var inputNumber:Number = 5;

if( inputNumber%2 ==0 )
trace( “Given Number is Even” );
else
trace( “Given Number is ODD” );
%= (Modulus Assignment)
The modulus assignment operator divides the value stored in the left variable by the right …

ActionScript 2.0, ActionScript 3.0, Flash CS4 »

[13 Dec 2010 | No Comment | ]
Remove Duplicate Array Elements

Like in SQL query to remove the duplicate item from a list of output, there is no built-in function in actionscript to remove duplicate content in an Array.
We are going to create custom function in actionscript which strips or removes duplicate content from Array.
Remove duplicate Array Contents
Basics of Array
http://www.designscripting.com/2010/11/actionscript-basics-part-4/
function removeDuplicate(targetArray:Array) : void{
var i:int;
var j: int;
for (i = 0; i < targetArray.length – 1; i++){
for (j = i + 1; j …

ActionScript 2.0, ActionScript 3.0, Flash CS4 »

[9 Dec 2010 | No Comment | ]
Delay Animation using As3

This tutorial will explain how to execute some chunk/ function/ animation after some time delay.
Delay function or Animation using as3
Using timer Class as3
Sample actionscript code for delay animation:
var _timer:Timer = new Timer(1000, 2);
_timer.addEventListener(TimerEvent.TIMER, triggered);
_timer.start();

function triggered(e:TimerEvent):void{
trace(“Times triggered: ” + e.currentTarget.currentCount);
trace(“Time Delayed: ” + e.currentTarget.delay);
}
Timer in actionscript and timer event in as3
First you have to import the classes related to the Timer, then you need to create new timer object using “new” keyword.
The first …

ActionScript 2.0, ActionScript 3.0, Flash CS4 »

[9 Dec 2010 | No Comment | ]
Append text to existing string in as3

As part of basics of ActionScript we are going to look how to append two text in Actionscript.
As it may look simple, but this is for newbie in AS3.
Append String in Actionscript / Append text in as3
To append two text or String datatype in Actionscript use “+” plus symbol and output the result or store the result in a Variable
Below is the actionscript code sample:
var myString:String = “Hello “;
trace( myString + “World!” );
Here, We have used string manipulation in as3 using the “+” to concatenate two Strings / text and output …

ActionScript 2.0, ActionScript 3.0, Webmasters »

[1 Dec 2010 | No Comment | ]
Adobe Releases – Adobe Flash Player 10.2

Key new capabilities in the Flash Player 10.2 beta include:
Flash Player 10.2 introduces new features and enhancements, including a new video hardware acceleration model that enables dramatically enhanced video playback performance.
Stage Video hardware acceleration — A new method for video playback in Flash Player will allow developers to leverage complete hardware acceleration of the video rendering pipeline, enabling best-in-class playback performance. Stage Video can dramatically decrease processor usage and enables higher frame rates, reduced memory usage, and greater pixel fidelity and quality.
Internet Explorer 9 hardware accelerated rendering support — Flash …