sevenson.com.au logo

MathML Parser written in ActionScript 3

In a similar fashion to my AS3 Graphing Classes, my MathML parser was created out of necessity. I was working on a project that had to display some equations, but drawing them out manually seemed a bit over the top.

I originally looked to see if anything was already available on the net but had no luck. Considering that the only other option was to create each equation manually, I decided to try and write my own MathML parser.

After a bit of research and playing around I came up with a set of classes that worked in a recursive manner to generate the equation.

The example file below demonstrates how the parser works.


Open interactive demo

Download:

For anyone who finds themselves in need of some MathML ActionScript classes, I have moved them onto GitHub.

They are by no means a complete solution, but they may prove useful to someone. Feel free to use them as you see fit, but please don’t harass me if you don’t like my code 😉

On the side note, there is a program called Amaya that can be used to generate MathML in a pretty easy to use interface. You can download it for free from here.


5 thoughts on “MathML Parser written in ActionScript 3

  1. Thank you so much, this is really what I need…even if I still don’t know how to adapt it to my code ( I already have a XML in which I would like to put the formulas).

  2. Hi,

    I have placed the following code as given, but it was throwing an error “Expecting right pare before colon.”

    var $sprite:Sprite = MathML.parse(MathML:XML[“test.xml”, $format:TextFormat=null, $embedFonts:Boolean=null ]);

    can anyone help?

  3. Hi,

    I would be grateful if you could share to me a complete example in how to use the MathML classes. I am a nearby.

    Thanks in advance,

    Francisco


Leave a Reply

Your email address will not be published. Required fields are marked *

Name *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


sevenson.com.au