First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Patrick Mineault | Website: http://dakar.netqcca.com

Now in order to better see the effect of the script you should add a second frame to your movie and put a large image file so that you have the time to watch it load. Press Ctrl+Enter twice in order to simulate loading using the Show Streaming feature.

We've approximated our circle mask with a collection of 100 triangles with a sharp angle of 3.6 degrees. In order to keep track with what we've drawn and what we have not we set up two vars: loaded and oldLoaded. Then on each frame the enterFrame event is called: all triangles with numbers between the value oldLoaded and loaded are the drawn.

The drawing takes place inside the addSlice function. It uses the relations derived above to get the coordinates of each of the corners of the triangle. It then draws it using the same functions as before. By now you should be familiar with the standard procedure: set up an empty movie clip, set it as the mask of a target, then draw some shapes in it. Before I finish I should mention the use of _root.mask._yscale = -100. On a computer screen the positive y-axis does down, while in the Cartesian system it goes up. Therefore a reflection about the horizontal axis is necessary in order to keep our angle relations valid.


You now have plenty of tools for creating all kinds of masking effects. In this tutorial I've willfully avoided the more complex aspects of the drawing API such as drawing curves. This was done in order to show you that using the drawing API in drawing masks was really quite simple and natural.

If you've enjoyed this tutorial, please take the time to visit dakar.netqcca.com. I am participating in a project in international development in May and am in dire need of funding. I'm organizing an actionscript-o-thon and also accepting donations. See the URL above for details. Thanks.

» Level Advanced

Added: 2004-03-26
Rating: 8 Votes: 15
(10 being the highest)
» Author
Always looking for a new challenge, I'm going to Senegal this summer to lend my computer skills in a volunteering project. I'm sending you this tutorial as part of my fundraising campaign, see http://dakar.netqcca.com . Enjoy!
» 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: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.