fMath for Java is a FREE solution to display and edit mathematics on web pages using Java components.

MathML Editor Component for Flex


Install the component in Flex Builder
	- Download the Formula component 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 Editor component


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" 
xmlns:fmath="http://www.fmath.info" width="1238" applicationComplete="init()">
<mx:Script>
		<![CDATA[
			import fmath.api.gui.events.KeyboardLockEvent;
			import mx.controls.*;
		
			protected function getMathML(event:MouseEvent):void
			{
				textareaId.text = editorId.mathML
			}
			protected function setMathML(event:MouseEvent):void
			{
				editorId.mathML = textareaId.text;
			}
			
			protected function saveImageToServer(event:MouseEvent):void{
				// import learnmath.mathml.formula.util.*;
				// var imageByteArray:ByteArray = 
				// Base64.decodeToByteArray( editorId.getBase64Image('PNG') );
				editorId.saveImageOnServer(callbackName);
			}
			
			protected function callbackName(name:String):void{
				Alert.show("Image url: " + name);
			}
			protected function viewImageInBrowser(event:MouseEvent):void{
				editorId.viewImageInBrowser();
			}
			protected function takeKeyboard():void{
				stage.dispatchEvent( new KeyboardLockEvent( "TestEditorProject", true ) );
			}
			
		]]>
	</mx:Script>
	<mx:HBox  horizontalAlign="center" backgroundColor="#eeeeee" borderColor="#000000" 
	borderStyle="solid" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">	
		<fmath:MathMLEditor id="editorId" editorWidth="800" editorHeight="500">
			<fmath:mathML><![CDATA[<mrow><mtext>abc</mtext></mrow>]]></fmath:mathML>
		</fmath:MathMLEditor>
		<mx:VBox width="409" height="500">
			<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="418" height="415" editable="true" id="textareaId" 
			borderColor="#7AD2E2" wordWrap="false" click="takeKeyboard()"/>
			<mx:HBox>
				<mx:ComboBox editable="false" selectedIndex="1">
					<mx:ArrayCollection>
						<mx:String>Value 1</mx:String>
						<mx:String>Value 2</mx:String>
						<mx:String>Value 3</mx:String>
					</mx:ArrayCollection>
				</mx:ComboBox>
				<mx:Button click="saveImageToServer(event)" label="Save img to Server"/>
				<mx:Button click="viewImageInBrowser(event)" label="View img in browser"/>
			</mx:HBox>
		</mx:VBox>
	</mx:HBox>
</mx:Application>


Settings

		<fmath:MathMLEditor id="editorId" editorWidth="800" editorHeight="500">
			<fmath:mathML><![CDATA[<mrow><mtext>abc</mtext></mrow>]]></fmath:mathML>
		</fmath:MathMLEditor>


	editorWidth  	- The width of editor component, default is 800
	editorHeight 	- The height of editor component, default is 500
	mathML  	- The mathml for formula. 






Deployment
	- DO NOT FORGET to copy also the folders fontswf and lookAndFeel with the distribution
	- The folders MUST be in the same folder with your application

`


www.learn-math.info | www.apprendre-math.info | www.aprender-mat.info | www.invata-mate.info
Designed by Diana Alexandru
free components MathML flex GWT LaTeX Web Editor free plugin MathML flash math Mathematics Equation Widget MathML flash LaTeX Mathematics FREE Editor Java