Actionscript Snippets

Got an interesting Actionscript snippet? Submit it!

Color an MC using lmc_tween.as librariesThis piece of code can be used to create color tweens. For example, you can tint a red square to a green in x seconds. It requires downloading tween prototypes from here :http://laco.wz.cz/tween/?page=download
Explode() functionYou can use to function the same way it is used in PHP
Movie Clip HandlerIn Flash you can attach code to Movie Clips. To do that, you must click on the object and then drop the code there.
Draw Circle with ActionscriptCode that enables you to draw a circle with Actionscript
Hexadecimal Code for a Skin ColorHere's a hexadecimal code to produce natural-looking skin color.
setIntervalThe following example traces a message at an interval of 20 milliseconds, up to 10 times, and then clears the interval.
Opening URLs in FlashLoads a document from the specified URL into the specified window. You can also use the getURL() method to pass variables to another application that is defined at the URL by using a GET or POST method.
Ternary Operator in FlashThis is a very quick way of creating conditional statements. Especially useful when you need to make a lot of conditional statements that make up much of your code.