AlfredEq v2.0 - Alfred's Equation Editor

Alfred's Equation Editor is a beautiful app to edit mathematical expressions on the web. It was originally built for government agencies working on e-learning solutions. Simply license the software or code and embed it in your CMS/LMS/wiki.

Try it on ShareMath

Here you can see an example of AlfredEq embedded on

AlfredEq used by

Main Features

Stop handwriting formulas or handcrafting MathML/TeX code.

Download Developer Edition

For evaluation purposes only and not for commercial use. Do not use on production servers.

AlfredEq-README.html: this. the Markdown version of this help.

Embed-swfobject folder:
-AlfredEq_unlicensed.swf (default) and AlfredEq_RSL_unlicensed.swf. The RSL version uses Adobe hosted Runtime Shared Libraries to reduce load time (framework_4.6.0.23201.swz, textLayout_2.0.0.232.swz, spark_4.6.0.23201.swz, rpc_4.6.0.23201.swz). This moves about 1 MB of libraries to the Adobe network with long cache settings.
- It also contains sample html files using SWFObject. Default is the index.html which use SWFObject Static (not indexdynamic.html which uses SWFObject Dynamic). - French version of the sample html files: and
- SWFObject files: swfobject.js, expressInstall.swf and the "src" folder.

DecodePNG folder:
- ActionScript 3 library to decode PNGs.

LocalConnection folder:
- Example code to communicate between a Flash file and AlfredEq.swf using ActionScript 3. See Configure DefaultConfiguration.xml.

License the Software or the Code

Contact Carl Malartre/Scolab Inc. for pricing:
- 1-888-528-8878 ext. 801 (toll free in North America)
- (514) 528-8066 (Montreal region in Canada)

Get Support

Contact Carl Malartre/Scolab Inc. for support:
- 1-888-528-8878 ext. 801 (toll free in North America)
- (514) 528-8066 (Montreal region in Canada)

System Requirements


Configure the Embed Code with FlashVars

We use SWFObject to load the Flash object. See the SWFObject Documentation.

"The FlashVars parameter of the HTML <OBJECT> tag sends variables into the top level of a SWF file when it loads in a web browser. The <OBJECT> tag is used to add SWF files to HTML pages. The <EMBED> tag can also be used, but is older and now obsolete." See Adobe's Pass variables to SWFs guide.

Warning: they are case-sensitive.

We are using two FlashVars:

Suppose you copy DefaultConfiguration.xml to /myfolder/myconfig.xml and use the French version:

<param name="flashvars" value="configLocation=/anyfolder/myconfig.xml&lang=fr" />

Configure DefaultConfiguration.xml

First, download DefaultConfiguration.xml.

Edit the configuration file and read how to configure FlashVars. It is self-explanatory.

SaveTarget defines how the equation is saved when the user click on the save button. Save button will appear only if a method is defined here. Images are a capture of the equation returned as a Base64/EscapeMultiByte encoded PNG






LoadTarget defines how the content is initially loaded. If no method is defined, an empty equation is created.




ReportProblem defines where the bug reports are sent. The script can accept the following parameters (see Server-side example):




Catch these JavaScript events readyFunction: JavaScript function to call when actionscript edit functions are made available to JavaScript.

changeFunction: JavaScript function to call when the equation change.



Call these JavaScript events List of ActionScript functions available to the JavaScript container. The container must wait a call to readyFunction before it can call the functions.

Returns the MathML markup
function exportSource():String

Returns a capture of the equation as a Base64/EscapeMultiByte encoded PNG
function exportImage():String

Set the content of the editor, clears the undo history
function setSource(value:String):void

Will open the send report window
function reportProblem():void

See's MathML 3 - Chapter 3 - Presentation Markup for these configurations, except for fontLookup.

<!-- fontLookup(device|embeddedCFF) -->

Server-side example

Image conversion example - ASP.Net & Visual Basic.Net

```VbNet Dim writer As New System.IO.FileStream(Server.MapPath(filename), IO.FileMode.Create)

    Dim bytes() As Byte = System.Convert.FromBase64String(Server.UrlDecode(Request.Params("imageData")))
    writer.Write(bytes, 0, bytes.Length)
Catch ex As Exception

End Try


How to get MathML or a PNG image VB.Net - ASP.Net & Visual Basic.Net

```VbNet <%@ Page Language="VB" %>

<script runat="server">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

        ' How to save the equation as a MathML XML file
        If Not Request.Params("content") Is Nothing Then
            Dim documentXml As New System.Xml.XmlDocument()

                Dim saveLocation As String = Server.MapPath("CHANGETHIS_FILENAME.xml")
            Catch ex As Exception

            End Try
        End If

        ' How to save the equation as an image (PNG)
        If Not Request.Params("image") Is Nothing Then
            Dim filename As String = ""

            Dim writer As New System.IO.FileStream(Server.MapPath(CHANGETHIS_FILENAME.png), IO.FileMode.Create)

                Dim bytes() As Byte = System.Convert.FromBase64String(Server.UrlDecode(Request.Params("image")))
                writer.Write(bytes, 0, bytes.Length)
            Catch ex As Exception

            End Try
        End If

        ' If you want to send the MathML back to the client browser as a downloaded file, use something similar to this:

        ' Dim fileName As String = "CHANGETHIS_FILENAME.xml"
        ' Response.AddHeader("content-disposition", "attachment; filename=" & fileName)
        ' Response.TransmitFile(Server.MapPath(fileName))

    End Sub



Image Decoder

If you use ActionScript 3 but don't use Flex, you can download the open source code (Apache v2 License) from the Apache Flex Repository.

Size, Web Caching & Runtime Shared Libraries

The editor app weights around 1.5MB. This looks big if you think of it as a web page, but think of it as an app loaded from the browser's cache.

Set your web server cache directives for the file AlfredEq.swf and setup ETags. This will help proxy caches. The web server should send an http header to tell all browsers, proxy and gateway caches to keep it for 1 to 30 days. Here's one day (in seconds):

Cache-Control: max-age=86400, must-revalidate, public

Use the "lighter" AlfredEqRSLunlicensed.swf. The RSL version uses Adobe hosted Runtime Shared Libraries to reduce load time (framework4.6.0.23201.swz, textLayout2.0.0.232.swz, spark4.6.0.23201.swz, rpc4.6.0.23201.swz). This moves 1 MB of libraries to the Adobe network with long cache settings.

Privacy & Tracking

This software collects anonymous app loading and click events for statistical purposes on Google Analytics and We do not track any data that personally identifies an individual.

Sample data sent to

&playerType=standalone (see ActionScript 3 documentation)

Future Work: TeX Support, iOS/Android, JavaScript

Coded for the Flash Runtime

Project Licenses

Standing on the shoulders of giants, this project:


It was originally built by Scolab inc. for and

Special thanks to the SOFAD and CFORP's trust and financial support:

This app would be way less cool without them!


Tags: mathematical expressions, mathematical formulae, mathematical formulas, and formula editor.

Prior to 2012, AlfredEq "Alfred's Equation Editor" was also called BuzzMath Equation Editor and NmEquation.

This is written using Markdown and MarkdownPad.