Example 5 - Using Masking in a Mathlet

In this example we present a mathlet which illuminates the definite integral in terms of areas. Click on the screen shot to open the mathlet in a separate window.

The code for the applet is too long to display on this page. Download the fla file below and examine the well-commented code.

Download

Two objects are masked in this mathlet: the green-shaded area which becomes "unmasked" as the user slides the slider (very much as in Example 1 of this tutorial), and the graph of a f(x) which may very well go beyond the graphing board. Particularly that not much in the applet is hard-wired and you can easily extend the applet to allow the user's input for x and y ranges as well as for f(x). To do the latter however, you need a mathematical formulas parser. You can find such parser, MathParser, in our package of custom classes bkde.as3.*. You can download the package from any of the ActionScript 3 development articles in Custom Clases for Mathematics section of this website.

Back to Intermediate Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.