Install the components in Flex Builder 4.6 - Standaloane example |
- Download the Formula components from download area (swc file and fonts)' - Unzip the package - Copy the swc file in your project/libs - Now you can see the component in Flex Builder - Design Mode ![]() - Copy the folder fontswf in project/bin-debug - Now you can test the component |
How to use MathML/Latex Formula components - Standaloane example |
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:fmath="http://www.fmath.info" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ protected function getLatex(event:MouseEvent):void { textareaLatexId.text = latexFormulaID.latex; } protected function setLatex(event:MouseEvent):void { latexFormulaID.latex = textareaLatexId.text; } protected function getMathML(event:MouseEvent):void { textareaId.text = new XML(mathmlFormulaID.mathML).toXMLString(); } protected function setMathML(event:MouseEvent):void { mathmlFormulaID.mathML = textareaId.text; } fmath.MathMLFormulaComp.setFolderUrlForFonts("./fonts"); ]]> </fx:Script> <mx:VBox height="100%" width="100%" horizontalAlign="center" backgroundColor="#eeeeee" borderColor="#000000" borderStyle="solid" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:HBox verticalAlign="middle"> <s:Label color="#106A70" fontSize="16" fontWeight="bold" text="Latex Example:"/> <fmath:LatexFormula id="latexFormulaID" latex="\[(a+b)^2\]" mathcolor="#FF0F67" mathsize="35"/> </mx:HBox> <mx:HBox> <mx:Button click="getLatex(event)" label="get Latex from component"/> <mx:Button click="setLatex(event)" label="set Latex to component"/> </mx:HBox> <mx:TextArea width="434" height="50" editable="true" id="textareaLatexId" borderColor="#7AD2E2" wordWrap="false"/> <mx:HBox verticalAlign="middle"> <s:Label color="#106A70" fontSize="16" fontWeight="bold" text="MathML Example:"/> <fmath:MathMLFormula id="mathmlFormulaID" mathsize="35" mathvariant="circle" mathcolor="#0F0F67" > <fmath:mathML><![CDATA[<mrow><mrow><msup><mn>2</mn><mrow><msup><mi>x</mi><mn>2</mn> </msup><mo>+</mo><mrow><mn>4</mn><mi>x</mi></mrow><mo>+</mo> <mn>4</mn></mrow></msup><mo>+</mo><mrow><mn>4</mn><mi>x</mi></mrow><mo>+</mo> <mn>45</mn></mrow><mo>=</mo><mn>0</mn></mrow>]]> </fmath:mathML> </fmath:MathMLFormula> </mx:HBox> <mx:HBox> <mx:Button click="getMathML(event)" label="get MathML from component"/> <mx:Button click="setMathML(event)" label="set MathML to component"/> </mx:HBox> <mx:TextArea width="434" height="290" editable="true" id="textareaId" borderColor="#7AD2E2" wordWrap="false"/> </mx:VBox> </s:Application> ![]() |
Settings |
<fmath:MathMLFormula mathsize="35" mathvariant="sans-serif" mathcolor="#850E0E" > <fmath:mathML> <![CDATA[<mrow><mrow><msup><mn>2</mn><mrow><msup><mi>x</mi> <mn>2</mn></msup><mo>+</mo><mrow><mn>4</mn><mi>x</mi> </mrow><mo>+</mo><mn>4</mn></mrow></msup><mo>+</mo> <mrow><mn>4</mn><mi>x</mi></mrow><mo>+</mo><mn>45</mn> </mrow><mo>=</mo><mn>0</mn></mrow>]]> </fmath:mathML> </fmath:MathMLFormula> mathsize - The font size used for formula, default is 24 mathvariant - The font family used for formula, default is normal mathcolor - The font color used for formula, default is #000000 mathML - The mathml for MathML formula latex - The latex for Latex formula ![]() |
Deployment |
- DO NOT FORGET to copy also the folder fonts with the distribution - The folder fonts MUST be in the same folder with your application |
More info and settings for formula go Formula Tab |
Example: Online Test |
free components MathML flex GWT LaTeX Editor Air plugin MathML flash math Mathematics Equation Widget Mobile flash LaTeX Mathematics FREE Apple iOS OMML Android iPad iPhone Microsoft Word Latex MathML OMML Free |