Black Box A Copyright 2002 Indivision Productions (www.indivision.net) Joseph Miller You may use this code for free, even on sites that you are getting paid for. Just don’t sell the code itself as if you made it. In return, I only ask that you send me a link to whatever you use it on. This is for no other reason than being curious and wanting to know if anyone finds it useful. WHAT IT IS: Black Box is a movie clip that contains several simple special effects. All of these effects are becoming popular on the net. I put it together for three reasons. One, because I searched for these type of effects and found that nobody else has offered them. Two, because I need to use them often in my designs and was tired of cutting, pasting and modifying them each time. Three, to make them as easy as possible to use, even for someone with very limited flash experience. HOW IT WORKS: Black Box contains a series of functions that perform the effects on a target movieclip. Once an effect is called, it duplicates itself. This is important because it allows multiple effects to take place at the same time. HOW TO USE IT: A. SETUP: Open “blackboxA.fla”. Copy the black box movieclip (located in the upper left corner of the screen). It’s hard to miss because it looks like a simple black box. Now, paste the movieclip into your movie where you want the effects to be available. Select the new box and go to windows>panels>instance. Name the MC to “blackbox”. That’s it for the setup! B. SYNTAX: To use an effect, enter one of the command lines listed below with the appropriate variables filled in. You do this in the actionscript window. If you are in normal mode, selecting ‘evaluate’ will allow you to enter a one line command. Be sure to enter the correct “path to target” relative to the _root. For example, if you want to affect an MC called “myclip1” you would enter “_root.myclip1”. Also note that although the rate variable usually increases the speed of the effect as its value is raised, there are a few effects (spin, slide) that move slower at higher values. COMMAND LINES: FLASH: blackbox.flash(“path to target”, flash rate, duration, fadeout duration); FADE: blackbox.fade(“path to target”, alpha start, alpha finish, rate); STROBE: blackbox.fade(“path to target”, strobe rate, duration); STATIC: blackbox.fade(“path to target”, strobe rate range, duration); MOVE: blackbox.fade(“path to target”, x change, y change, rate); SIZE: blackbox.fade(“path to target”, width change, height change, rate); SLIDE: blackbox.fade(“path to target”, x change, y change, rate); TURN: blackbox.fade(“path to target”, rotation, rate); SPIN: blackbox.fade(“path to target”, rotation, rate); SHAKE: blackbox.fade(“path to target”, x shake range, y shake range, duration); ADDITIONAL USAGE NOTES: In order to work properly, Black Box makes duplicates of itself on consecutive levels. In other words, if you are working with a movie that uses several levels for some other flash effect, you will need to control where the Black Box places duplicates. As a default, Black Box starts placing duplicates at level 1 and moves up. You can change the start level by designating the variable ‘base’ in the root time-line to whatever is necessary. By itself, Black Box is 7k which might be a little more than you want. In that case, you can do the surgery pretty easily and remove the functions you don't need. Finally, have fun! It’s pretty flexible so you can use most of the effects simultaneously on the same object. The code could be condensed some and I plan on adding many more effects in the future so check back at the site. If you have any questions, PLEASE use the forum at www.indivision.net . If you ask me there, I will answer 10 times faster! Joseph Miller