First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Joachim Schnier | Website:

Setting up the fla file

For this particular tutorial file you need only two items: a button and a rectangle movieclip of any size, which we name mask and which stays in the library. Since we need to attach it later to another movieclip, click on the icon in the library and then select linkage from the menu. Click on export for actionscript. Now create five buttons as in our example and one frame for actionscript. Name the buttons but1, but2 and so on. Next we will put a script in the actions frame.

The Actionscript in the Fla File

In the actionscript frame put this script:

import as_scripts.*;
_root.but1.onPress = function() {
    fader.createMC(200, 75);
_root.but2.onPress = function() {
_root.but3.onPress = function() {
    fader.maskMC(250, 100, 100, 100);
_root.but4.onPress = function() {
_root.but5.onPress = function() {
The first line is a wildcard expression and will import all scripts from a folder as_ascripts. I like this shortcut because then I do not have to care any more about the path of any of the scripts in the folder. Then we give functions to the buttons by referring to the fader class. All our functions as you will see are static functions and that is why we have to refer to these functions over the class name. What exactly these functions are you will see in the next section. But as you can see here some of the functions have arguments, either the path and name of a slide or numbers, which as you will see are the x and y coordinates to place objects.

» Level Intermediate

Added: 2004-09-21
Rating: 7 Votes: 6
(10 being the highest)
» Author
The author is a cancer researcher and Flash developer.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.