07Aug Flash Tutorial: Flash Stage Size
Recently stumbled onto a blog post that pointed out the fact that you could use loaderInfo.width/height properties in junction with determining the center of the stage. This information helps a lot as I have found that IE6 will sometimes not report the correct size of the SWF in the browser on the stage properties .width [...]
06Aug Flash TOTD: Reverse loop with increment iterator
This can be done several ways… here are two of the faster performance-wise ways for this:
var maxNum:int = 5;
var inverse_i:int;
for(var i:int=maxNum; i => 0 ; i–) {
inverse_i = maxNum - i;
trace(inverse_i);
}
// or you can do this:
var inverse_i:int;
for(var i:int=5; i => 0 ; i–) {
trace(inverse_i);
inverse_i++;
}
05Aug Flash: Creation of general children
In the event of making new children, especially like library movieclips, you could create a generic function that receives the class reference for the movieclip you wish to create. For the below example, let’s say in your library is a RedBox linked movieclip with a variety of other movieclips like it that all need to [...]
01Aug Flash TOTD: inline functions
This is useful when performing a small quick function that perhaps handles an event listener callback.
var onClickNavAway:Function = function(e:Event) {
navigateToURL(new URLRequest("link.html"),"_self");
}
addEventListener(MouseEvent.CLICK, onClickNavAway);
31Jul Flash Tip of the Day
I am going to try to post something code related everyday (maybe except for the weekend). So today I will cover a super easy tip:
When setting the same property on different objects, you can same time by instead of doing this:
movieClip1.visible = false;
movieClip2.visible = false;
movieClip3.visible = false;
Do This:
movieClip1.visible=movieClip2.visible=movieClip3.visible=false;
Easy, huh?

