Flash Tools for Developers: Truth Tables and Logic

Author(s): 
Doug Ensley and Barbara Kaskosz

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

This Flash Forum article provides instructions and resources for producing customized truth table applications.  This includes classes for parsing and evaluating expressions using simple propositional connectives and, or, not, implies and iff.

The compressed file truth_table_tutorial.zip contains all templates and code referenced within the article, and the brief Developer's Guide ( truth_tables_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. One template includes the use of an XML data file to provide truth table exercises.

Flash Tools for Developers: Truth Tables and Logic - Overview

Author(s): 
Doug Ensley and Barbara Kaskosz

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

This Flash Forum article provides instructions and resources for producing customized truth table applications.  This includes classes for parsing and evaluating expressions using simple propositional connectives and, or, not, implies and iff.

The compressed file truth_table_tutorial.zip contains all templates and code referenced within the article, and the brief Developer's Guide ( truth_tables_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. One template includes the use of an XML data file to provide truth table exercises.

Flash Tools for Developers: Truth Tables and Logic - Description of the Templates

Author(s): 
Doug Ensley and Barbara Kaskosz

The compressed file truth_table_tutorial.zip contains all templates and code referenced within the article, and the brief Developer's Guidetruth_tables_guide.pdf  ) gives detailed instructions for some specific customization tasks.  Try out the templates below by clicking on the appropriate thumbnail image.


Template 1.

The first template consists of a basic "truth table builder" for expressions in three variables.  The Developer's guide explains how to make the following changes to this template:

  • You can change the names of the variables to be used and make corresponding changes to the text on the stage.
  • You can reduce the number of variables in the truth table from 3 to 2 by making the appropriate changes to the code and the stage.


Template 2.

The second template consists of a typical student-centered activity that one could make using the classes developed for this article. This template pulls a series of exercises from an external data file and challenges the student to supply the correct truth table. The program checks the student answer for correctness and provides feedback. 

Instructions are given for changing the source code to make the exercise set internally defined rather than externally defined, if that is preferable. A brief discussion of how to use an XML data file for external definitions is included.

Flash Tools for Developers: Truth Tables and Logic - Outline of the Developer's Guide

Author(s): 
Doug Ensley and Barbara Kaskosz

The following outline describes what can be accomplished by following the Truth Table Developer's Guide after downloading all source files to your machine with Flash 8 installed.

  1. Getting started. Download and unzip the relevant files including the documented source code and the detailed doc file with instructions for customization.
  2. The First Template. An overview of the structure of the Flash source file tt3vars.fla is given, and two customization tasks are undertaken to give the instructor a sense for how the application works.
    1. Changing the names of the variables. In order to use different variable names, we must make changes to the script in the calls to the TruthParser constructor and each evaluation of the logical expression. In addition, the corresponding changes to the static text on the stage (column labels and instructions) are equally important to the user.
    2. Changing the number of variables. We create a new Flash movie called tt2vars.fla that builds truth tables in two variables instead of three.  This task is only more complicated in the sense that it requires more changes to the existing movie, but each change is just as easy as those made in previous task.
  3. The Second Template. An overview of the structure of the Flash source file tt3xml.fla is given, and we discuss how it communicates with the XML data file tt3problems.xml.  In particular, we provide an alternative method for specifying the logical expressions to be used in a problem set.
  4. Reference. For those developers who would like more detail on the handling of XML data files in Flash, we include a reference to a short article on this subject written for the MathDL Flash Forum by the authors of this guide.

Flash Tools for Developers: Truth Tables and Logic - Getting the Files

Author(s): 
Doug Ensley and Barbara Kaskosz

Download the 5-pagetruth_tables_guide.pdf for detailed instructions for customizing the Function Grapher.

Download the truth_table_tutorial.zip file and unzip it in to your computer. You will see the truth_table_tutorial 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 tt3vars.fla and tt3xml.fla. In addition, the file tt3xml.fla is provided as a two-variable implementation of the second template file.
  • The files tt3vars.html, tt3xml.html and tt2xml.html (along with the corresponding swf files) allow you to try out the truth table activities on which this guide is based.
  • The files tt3problems.xml and tt2problems.xml provide data for the XML based problems. These files can be viewed and edited using any text editor.

Working right from the folder truth_table_tutorial, you can open one of the three .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.