Try.. Try.. Try.. Error Supression – taterboy
August 27th, 2008 | Filed under: Flash AS2 to AS3, Tips
One of my favorite statements is try..catch..finally.
When building web applications, we as developers need to plan for the unexpected. We know the web does not always behave at the same level of consistency for all users. This does not take into account client systems which can compound minor glitches.
There are also times that you need to compile code that is reliant on external variables. If all the conditions are not returned in a valid format AS3, being very strict, will throw an error and not complete the remaining code sequences as intended.
Read More »
Flash and Javascript Communication – taterboy
August 20th, 2008 | Filed under: Flash AS2 to AS3, Tips
Passing Flash variables to Javascript, passing Javscript variables to Flash, Calling Flash functions from Javascript.
There are a few conventions for getting Flash and Javascript to communicate like fscommand, getURL, LocalConnection, URL-encoded variables, FlashVars, SetVariable and TCallLabel to name a few.
Here is a little demo using Flash’s External Interface and Javascript. It is more elegant then most of the procedures I have used in the past. Between External Interface and FlashVars, you should be able to fill most of your needs.
Read More »
ActionScript 2 (AS2) SuperLoader – taterboy
August 13th, 2008 | Filed under: Tips
Here is an AS2 version of the SuperLoader. It works just like the AS3 version found in the Custom HTML Templates post.
Quick Use:
1. Add loaderbar.swf and mainLoader.swf to your current project directory.
2. In the html file for your current project, replace the src and movie parameters to mainLoader.
3. Then add [,'flashVars','swfURL=FlashProjectToLoad.swf'] to the load script.
Read More »
Simple Hex Color Changer w/ ColorTransform – taterboy
August 6th, 2008 | Filed under: Flash AS2 to AS3, Tips
I was first introduced to the ColorTransform class while reading the AS2 to AS3 migration documentation about setRGB(). I was immediately impressed with the features, but intimidated when I saw the constructor and all the offset, color and alpha arguments. I just needed to change the color of something, nothing special, no gradients, no alpha, no space shuttle landings, just a simple hex color change.
So here is a simple color change utility that is a lot closer to what I am used to.
function paint(obj:Object,color:Number):void{
var ct:ColorTransform = new ColorTransform();
ct.color = color;
obj.transform.colorTransform = ct;
} |
source here