Archive | ActionScript RSS feed for this section

MovieClip Saturation Class – ActionScript 2

This ActionScript 2.0 Class enables you to easily adjust the colour saturation of any Flash MovieClip during runtime. It requires Flash Player version 8 or above, and uses the ColourTransformationMatrix and some clever jiggery-pokery to adjust the RGBA channels of your MovieClips. In short, it’s sweet – and fills a gap in the built-in flash filter classes.

Have a look at this flash movie (below) to see the end result, all generated from the same MovieClip.

Read More…

Flash, 16bit colour, blendModes and cacheAsBitmap. A recipie for disaster?

Apparently so. Read More…

ActionScript Debugging

This is a simple little segment of code that i find very useful to work my way through flash files. It basically lists all the properties (which includes direct children) of the target movieclip. Here’s a few implimentations…

(Set n beforehand with something like var n = my_mc)

for(var i in n){
trace(i+" : "+n[i]);
};

and thats it in a nutshell. Your output will be something like this;

property : value

Ok, so thats not a very good example, but try it and you’ll see.
Here’s a function-based version for you…

traceProperties = function(movieclip){
n = movieclip;
for(i in n){
trace(i+" : "+n[i]);
}
}

and it’s Actionscript 2.0 sibling…

function traceProperties(n:Object):Void{
for(var i in n){
trace(i+" : "+n[i]);
}
}