Flash Tools for Developers: Matching Formulas to Data

Author(s): 
Doug Ensley, Barbara Kaskosz

Barbara Kaskosz, University of Rhode Island
Doug Ensley, Shippensburg University

This Flash Forum article includes source code and instructions for building an applet that allows the user to enter expressions with up to four parameters and then to vary the parameters in order to fit the curve to user data.

The compressed file match_formula.zip contains all templates and code referenced within the article, and the brief Developer's Guide (match_guide.pdf ) gives detailed instructions for some specific customization tasks.

Within this article, there is a short description of each of the templates including active versions to demonstrate the functionality of each. In addition, we outline some of the specific customizations that are addressed within the Developer's Guide.

Note: In this article, we are assuming that your are familiar with the basics of Flash's authoring environment. If not, please download the PDF guide from our earlier article "Flash Tools for Developers: Function Grapher," or visit the MathDL Flash Forum Learning Center at

http://www.math.uri.edu/~flashcenter/

Flash Tools for Developers: Matching Formulas to Data - Overview

Author(s): 
Doug Ensley, Barbara Kaskosz

Barbara Kaskosz, University of Rhode Island
Doug Ensley, Shippensburg University

This Flash Forum article includes source code and instructions for building an applet that allows the user to enter expressions with up to four parameters and then to vary the parameters in order to fit the curve to user data.

The compressed file match_formula.zip contains all templates and code referenced within the article, and the brief Developer's Guide (match_guide.pdf ) gives detailed instructions for some specific customization tasks.

Within this article, there is a short description of each of the templates including active versions to demonstrate the functionality of each. In addition, we outline some of the specific customizations that are addressed within the Developer's Guide.

Note: In this article, we are assuming that your are familiar with the basics of Flash's authoring environment. If not, please download the PDF guide from our earlier article "Flash Tools for Developers: Function Grapher," or visit the MathDL Flash Forum Learning Center at

http://www.math.uri.edu/~flashcenter/

Flash Tools for Developers: Matching Formulas to Data - Description of the Templates

Author(s): 
Doug Ensley, Barbara Kaskosz

Template 1.

The first template consists of the basic applet which allows the user to input data and a function with parameters (thereby essentially specifying a family of functions). The user can then change the parameters (via "scrolling" or direct keyboard input) and see the effect visually as well as numerically through the display of the least squares error that the curve makes in fitting the data.  The way that points are displayed can be varied to facilitate copying data from other applications (like CAS or spreadsheets) and pasting them into this applet.  Click on the screenshot below to try this template.

Template 1 Screenshot and Link


Template 2.

The second template consists of an exploration that is more focused on comparing the different ways of measuring error in the fit of a curve to a set of data points, but the basic components are the same as in the first template.  In this version, the user is told a specific syntax for entering points. Click on the screenshot below to try this template.

Template 2 Screenshot and Link

Flash Tools for Developers: Matching Formulas to Data - Outline of the Developer's Guide

Author(s): 
Doug Ensley, Barbara Kaskosz

The following outline describes what can be accomplished by following the Matching Formulas to Data Developer's Guide after downloading all source files to your machine with Flash 8 installed.  In this article, we are assuming that your are familiar with the basics of Flash's authoring environment. If not, please download the PDF guide from our earlier article "Flash Tools for Developers: Function Grapher," or visit our MathDL Flash Forum Learning Center at

http://www.math.uri.edu/~flashcenter/

  1. Getting started. Download and unzip the relevant files including the documented source code and the functional templates.  Familiarize yourself with the templates from the user point of view.
  2. The Templates. An overview of the structure of the Flash source file match_template1.fla is given.  Most of the details also pertain to the match_template2.fla file.  We highlight some of the new ideas in this discussion below.
    • Making your own radio buttons. Since Flash Components can make the fla files huge, we discuss how to write one's own class of radio buttons.
    • Using a blank button. To have the mouseover "syntax" and "how-to" effects in this applet, we use a blank button. This technique and its advantages are discussed here.
    • Attaching a clip at run time. The actual text that shows up when the user mouses over the "syntax" or "how to" buttons is part of a clip that is attached at run time.  This keeps the stage clear and allows the text to be edited more easily.
    • Using the classes. Classes used include MatchGraphingBoard, MathParser, RangeParser, and PointParser, the last of which is new to this applet.  Instructions are given for how to alter the functionality of the applet by varying parameters used with these classes.
  3. Description of Custom Classes. As in previous development articles, we give a technically specific description of each of the classes used by these templates.  This level of detail is provided for serious developers interested in modifying the classes rather than just using the classes.
  4. Suggestions for improvement and references. We offer a few suggestions for improvements that an ambitious developer might like to try, and as usual, we list some references that we believe will be useful in working with this material.

Flash Tools for Developers: Matching Formulas to Data - Getting the files

Author(s): 
Doug Ensley, Barbara Kaskosz

Download the 23-page match_guide.pdf for detailed instructions for customizing the two templates.

Download the match_formula.zip file and unzip it in to your computer. You will see the match_formula folder which contains all the files related to this article:

  • The folder edu contains all the necessary ActionScript classes in a nested sequence of folders.Note that for Flash to be able to find the classes, the folder edu must reside in the same folder as the template you are working on.
  • The two source files for the templates that will be discussed are match_template1.fla and match_template2.fla.
  • The files match_template1.html and match_template2.html (along with the corresponding swf files) allow you to try out the templates on which the guide is based.

Working right from the folder match_formula, you can open one of the two .fla files in Flash 8 Professional and begin customizing the application to your liking. If you prefer a clean working environment, create a new folder but be sure to include the edu folder alongside your programs that are to use these classes.