Home » Archive

Articles in the ActionScript 2.0 Category

ActionScript 2.0, ActionScript 3.0, Flex »

[10 Aug 2010 | No Comment | ]
Efficient AS3 Programming Practices

Some times our application may consume much memory or resource in runtime, There are ways to control the memory usage or CPU utilization of the application by efficient use of code.
Some of the ways:
1. While creating new Array or Object.
Never use
new Array();
new Object();
Always use
var object:Object = {};
var arr:Array = [];
2. Dont use too many dot syntax.
Never use
outcontainer.inner2.inner1.inner.x = 10;
outcontainer.inner2.inner1.inner.width = 100;
Always use
var spr:Sprite = outcontainer.inner2.inner1.inner as Sprite
spr.x = 10;
spr.width = 100;
Note: Idea is to hold reference of the Object
3. Use int in for loop
Example:
for( var …

ActionScript 2.0, ActionScript 3.0, Flash CS4, Flex »

[17 Jun 2010 | No Comment | ]

Formulae:
((X – minValue)/(maxValue – minValue)) * 100
Suppose we need to convert 14 – 100 as 0% – 100%
X may be any input from 14 to 100, and the calculation is
((X – 14)/(100 – 14)) * 100
This might be usefull in scrollBar calculations or when we want to restrict size of Image and so on.

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

[16 Dec 2009 | No Comment | ]
Free Flash/Flex Preloaders

Preloaders are much needed for Flash/Flex RIA’s.
Here some of the free preloader animations created by me this morning.

Idea of preloader is indicating the user that some assets are being loaded, and making them to wait.
But we should keep in mind that the user may lost their patience, so keeping the Flash assets filesize minimal is much important while making Flash websites or Flash applications.

ActionScript 2.0, ActionScript 3.0 »

[21 Jul 2009 | No Comment | ]
Mailto in Flash Actionscript

We can send mail directly using SMTP+Actionscript3.0 but here we are going to discuss about simple form of “mailto” function that just opens the default mail application with the supplied subject and body content.
Difficulty:
Beginners – intermediate
Version:
AS2 and AS3
Here we are going to see how to use mailto function in AS2 and AS3.

Actionscript2.0
Step1:
Open New Flash Document (File > New) from menu or (CTRL + N) shortcut
key.Select Flash File (Actionscript2.0)
Step2:
select the first keyframe on the layer1.
Step3:
Press F9 (Function key) or open the Actions Panel under the Windows menu.
Step4:
Paste the below code
getURL(”mailto:designscripting@gmail.com?subject=Test Message&body=Site …

ActionScript 2.0, ActionScript 3.0, Design »

[6 Jul 2009 | No Comment | ]

The launch of new search engine for Actionscript developers has made the life easier for the developers to search code snippets easier.
HexoSearch – The world’s first search engine dedicated for actionscript.
HexoSearch is aiming to provide the best actionscript search experience which we believe is to offer a best solution for any specific topic.

To achieve that, actionscript developers are able to vote for the link that they find useful. Given enough time, links that provide useful information will be pushed up to save everybody’s time.

ActionScript 2.0, ActionScript 3.0 »

[5 Mar 2009 | No Comment | ]

We can trace as many variables or Objects with single trace statements in both Actionscript 2.0 and Actionscript 3.0 without concat operator ‘+’
Actionscript 2.0
var one:Number = 1;
var two:String = “two”
trace([one, two]);
Actionscript 3.0
var one:Number = 1;
var two:String = “two”
trace(one, two);
one difference is that no need to use square brackets in AS3.0

ActionScript 2.0 »

[18 Feb 2009 | No Comment | ]

In my project there was a need to create unique alpha numeric value + to act as a substitute for session variables.
I serached internet and got this Class GUID.
It has one drawback that it always create GUID of length 40. So i made some change to generate GUID of specified length.
Version of Actionscript:
Actionscript 2.0
Here is the usage of the Class GUID
trace(GUID.create(40))
Note:
Make sure that GUID resides in the same folder.

ActionScript 2.0, XML »

[6 Jan 2009 | 10 Comments | ]

In this version2 of Dynamic slide show i have added preloading support and opening links on clicking the image..
Here you can have look t previous version
Nothing complicated from the previous version… just need to update the swf and xml
in xml
image url=”Images/image1.jpg” gotoURL=”http://www.designscripting.com” target=”_blank”
gotoURL = webpage to be opened on clicking
target = _blank | _self
_blank opens the link in new page;
_self opens the link in same page.
Next in slideshow is Fader Classes in AS3 with that its possible to Fade back to back images, wait till preloading, load animated swf …

ActionScript 2.0, ActionScript 3.0 »

[4 Dec 2008 | No Comment | ]

In my project i was passing array to another class(passing by reference). And i was editing the items there in another class(Composition). I was in a situation to resset the array. Then i suddenly reinitialized the array(arr = new Array() or arr = []).
That will create some error in application. Bcoz the reference will end there.
So its advisable to delete items alone. When passing the array references accross several Class.
var Num_arr:Array = new Array();
Num_arr.push(1)
Num_arr.push(6)
Num_arr.push(2)
Num_arr.push(4)
Num_arr.push(9)
trace(”–”+Num_arr+”–”)
arr.splice(0,Num_arr.length)
trace(”–”+Num_arr+”–”)
Happy coding

ActionScript 2.0, ActionScript 3.0, Flash CS4 »

[14 Nov 2008 | No Comment | ]

Flash player 10 is in beta … its time to check the Flash player version installed in your system and upgrade to latest Flash player..
There are some easy ways to check the player installed..
Follow the link and check the version

kb.adobe.com
duber.com
playerversion.com

Â
Dont have Adobe Flash Player….
Install Adobe Flash Player